From b77a893f12664ed1ef813f441bcc0135004ef1e3 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 15 Sep 2023 11:27:40 +0200 Subject: [PATCH 001/126] Creazione pagina pdf editor e aggiunta logo in PDF --- EgtBEAMWALL.Core/Constants/ConstColumns.vb | 17 + .../Constants/ConstDataGridColumnsIni.vb | 1 + EgtBEAMWALL.Core/Constants/ConstIni.vb | 5 + .../EgtDataGrid/EgtDataGrid.xaml.vb | 18 +- .../ConfigurationPage/ConfigurationPageV.xaml | 15 +- .../ConfigurationPage/ConfigurationPageVM.vb | 23 +- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 14 + .../Resources/PDFEditor/MoveDown.png | Bin 0 -> 432 bytes .../Resources/PDFEditor/MoveUp.png | Bin 0 -> 427 bytes .../Statistics/PDFEditorV.xaml | 135 ++++ .../Statistics/PDFEditorV.xaml.vb | 12 + .../Statistics/PDFEditorVM.vb | 257 +++++++ .../Statistics/PDFHelper.vb | 688 +++++++++++++----- EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb | 14 + 14 files changed, 1006 insertions(+), 193 deletions(-) create mode 100644 EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/MoveDown.png create mode 100644 EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/MoveUp.png create mode 100644 EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb diff --git a/EgtBEAMWALL.Core/Constants/ConstColumns.vb b/EgtBEAMWALL.Core/Constants/ConstColumns.vb index f8431e59..f0d283bb 100644 --- a/EgtBEAMWALL.Core/Constants/ConstColumns.vb +++ b/EgtBEAMWALL.Core/Constants/ConstColumns.vb @@ -3,9 +3,24 @@ Public Const COL_DO As String = "colDO" Public Const COL_VALUE As String = "colVALUE" Public Const COL_CUSTOM As String = "colCUSTOM" + Public Const COL_NAME As String = "colNAME" + Public Const COL_CALC As String = "colCALC" + Public Const COL_PDN As String = "colPDN" Public Const COL_STARTCUT As String = "colSTARTCUT" Public Const COL_W As String = "colW" + Public Const COL_H As String = "colH" Public Const COL_L As String = "colL" + Public Const COL_CNT As String = "colCNT" + Public Const COL_ADDED As String = "colADDED" + Public Const COL_INPROD As String = "colINPROD" + Public Const COL_DONE As String = "colDONE" + Public Const COL_MATERIAL As String = "colMATERIAL" + Public Const COL_UNITVOLUME As String = "colUNITVOLUME" + Public Const COL_TOTVOLUME As String = "colTOTVOLUME" + Public Const COL_UNITTIME As String = "colUNITTIME" + Public Const COL_TOTTIME As String = "colTOTTIME" + Public Const COL_USAGE As String = "colUSAGE" + Public Const COL_WASTE As String = "colWASTE" Public Const COL_POSZ As String = "colPOSZ" Public Const COL_ROT As String = "colROT" Public Const COL_FLIP As String = "colFLIP" @@ -15,7 +30,9 @@ Public Const COL_REDO As String = "colREDO" Public Const COL_TYPE As String = "colTYPE" Public Const COL_DESCRIPTION As String = "colDESCRIPTION" + Public Const COL_DESC As String = "colDESC" Public Const COL_SUPERVISORID As String = "colSUPERVISORID" Public Const COL_PRIORITY As String = "colPRIORITY" + Public Const COL_QTY As String = "colQTY" End Module diff --git a/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb b/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb index e8a55474..74d9c8a5 100644 --- a/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb +++ b/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb @@ -18,6 +18,7 @@ Public Const S_PARTLIST As String = "DG_PartList" Public Const S_FEATUREINPARTINRAWPARTLIST As String = "DG_FeatureInPartInRawPartList" Public Const S_STATISTICS As String = "DG_Statistics" + Public Const S_STATISTICS_PART As String = "DG_Statistics_PART" Public Const S_OPTIMIZERSTATISTICS As String = "DG_OptimizerStatistics" Public Const S_RAWPARTSTATISTICS As String = "DG_RawPartStatistics" Public Const S_BEAMMACHININGS As String = "DG_BeamMachinings" diff --git a/EgtBEAMWALL.Core/Constants/ConstIni.vb b/EgtBEAMWALL.Core/Constants/ConstIni.vb index 083d4c91..358f0064 100644 --- a/EgtBEAMWALL.Core/Constants/ConstIni.vb +++ b/EgtBEAMWALL.Core/Constants/ConstIni.vb @@ -159,4 +159,9 @@ Public Module ConstIni Public Const K_TYPE As String = "Type" Public Const K_DEFAULTQUANTITY As String = "DefaultQuantity" + Public Const S_SECTION As String = "Section_Checked" + Public Const S_IMAGE As String = "Image_Checked" + + Public Const S_PDFEDITOR As String = "PDFEditor" + End Module diff --git a/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb b/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb index 03fd17d7..75c50551 100644 --- a/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb +++ b/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb @@ -4,9 +4,6 @@ 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 @@ -367,9 +364,23 @@ Public Class EgtDataGrid End Class Public Class EgtDataGridColumn + Inherits VMBase Private m_dgColumn As DataGridColumn + 'Check Box per le singole colonne + Private m_bIsCheched As Boolean + Public Property bIsChecked As Boolean + Get + Return m_bIsCheched + End Get + Set(value As Boolean) + m_bIsCheched = value + NotifyPropertyChanged(NameOf(bIsChecked)) + WriteMainPrivateProfileString(S_PDFEDITOR, m_Name, If(m_bIsCheched, 1, 0)) + End Set + End Property + Private Property m_ParentDataGridName As String Public Property ParentDataGridName As String Get @@ -571,6 +582,7 @@ Public Class EgtDataGridColumn m_Visible = bVisible m_CanUserEditVisible = bCanUserEditVisible m_SortDirection = nSortDirection + m_bIsCheched = GetMainPrivateProfileInt(S_PDFEDITOR, m_Name, 0) <> 0 End Sub Friend Sub InitColumn(dgColumn As DataGridColumn) diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml index cdc3bc49..219d5e2e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml @@ -1,9 +1,9 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" + xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"> @@ -222,6 +222,11 @@ + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml.vb new file mode 100644 index 00000000..1dded60a --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml.vb @@ -0,0 +1,12 @@ +Public Class PDFEditorV + + Sub New() + + ' La chiamata è richiesta dalla finestra di progettazione. + InitializeComponent() + + ' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent(). + DataContext = New PDFEditorVM() + End Sub + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb new file mode 100644 index 00000000..9ffbabe2 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb @@ -0,0 +1,257 @@ +Imports System.Collections.ObjectModel +Imports EgtBEAMWALL.Core +Imports EgtWPFLib5 +Imports EgtUILib + +Public Class PDFEditorVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + 'Lista contenente le singole categorie + Private m_ExpanderList As New ObservableCollection(Of ExpanderPDF) + Public ReadOnly Property ExpanderList As ObservableCollection(Of ExpanderPDF) + Get + Return m_ExpanderList + End Get + End Property + +#End Region + + Sub New() + Map.SetRefPDFEditorVM(Me) + m_ExpanderList.Add(New ExpanderPDF(ListTypes.MACHGROUPTOT)) + m_ExpanderList.Add(New ExpanderPDF(ListTypes.MACHGROUP)) + m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_LIST)) + m_ExpanderList.Add(New ExpanderPDF(ListTypes.RAWPART)) + m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_TOT)) + m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART)) + End Sub + +End Class + +Public Class ExpanderPDF + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + 'Nome della categoria MachGroup Totals, MachGroup List, Raw Part e Raw Part List + Private m_sNameCategory As String + Public ReadOnly Property sNameCategory As String + Get + Return m_sNameCategory + End Get + End Property + + 'Lista degli elementi visualizzati nell'expander es Numero di grezzi o le colonne es colName + Private m_ExpanderElementList As New List(Of ExpanderPDF) + Public ReadOnly Property ExpanderElementList As List(Of ExpanderPDF) + Get + Return m_ExpanderElementList + End Get + End Property + +#End Region 'FIELDS & PROPERTIES + +#Region "CONTRUCTORS" + + Sub New() + End Sub + + Sub New(nListType As Integer) + Select Case nListType + Case ListTypes.MACHGROUPTOT + m_sNameCategory = EgtMsg(61729) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61721))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61717))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61719))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61718))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61720))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61722))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61723))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61724))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61725))) + Case ListTypes.MACHGROUP + m_sNameCategory = EgtMsg(61730) + m_ExpanderElementList.Add(New ExpanderTable(S_OPTIMIZERSTATISTICS)) + Case ListTypes.PART_LIST + m_sNameCategory = EgtMsg(61731) + m_ExpanderElementList.Add(New ExpanderTable(S_STATISTICS_PART)) + Case ListTypes.RAWPART + m_sNameCategory = EgtMsg(61732) + m_ExpanderElementList.Add(New ExpanderTable(S_RAWPARTSTATISTICS)) + Case ListTypes.PART_TOT + m_sNameCategory = EgtMsg(61734) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61716))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61717))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61718))) + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61720))) + Case ListTypes.PART + m_sNameCategory = EgtMsg(61733) + m_ExpanderElementList.Add(New ExpanderTable(S_STATISTICS)) + End Select + End Sub + +#End Region 'CONTRUCTORS + +End Class + +Public Class ExpanderElement + Inherits ExpanderPDF + +#Region "FIELDS & PROPERTIES" + + 'Nome dei parametri visualizzati nella sezione del PDF Machgroup Totals es Numero di grezzi + Private m_sNameParameter As String + Public ReadOnly Property sNameParameter As String + Get + Return m_sNameParameter + End Get + End Property + + 'Check Box dei parametri visualizzati nella sezione del PDF Machgroup Totals + Private m_bParameter_IsChecked As Boolean + Public Property bParameter_IsChecked As Boolean + Get + Return m_bParameter_IsChecked + End Get + Set(value As Boolean) + m_bParameter_IsChecked = value + NotifyPropertyChanged(NameOf(bParameter_IsChecked)) + WriteMainPrivateProfileString(S_PDFEDITOR, m_sNameParameter, If(m_bParameter_IsChecked, 1, 0)) + End Set + End Property + +#End Region 'FIELDS & PROPERTIES + +#Region "CONTRUCTORS" + + Sub New(NameParameter As String) + m_sNameParameter = NameParameter + m_bParameter_IsChecked = GetMainPrivateProfileInt(S_PDFEDITOR, m_sNameParameter, 0) <> 0 + End Sub + +#End Region 'CONTRUCTORS + +End Class + +Public Class ExpanderTable + Inherits ExpanderPDF + +#Region "FIELDS & PROPERTIES" + + 'Lista Colonne Tabella MachGroup List, RawPart List, PartList + Private m_RawPartColumns As New ObservableCollection(Of EgtDataGridColumn) + Public ReadOnly Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn) + Get + Return m_RawPartColumns + End Get + End Property + + 'Elemento delle Liste MachGroup List, RawPart List, PartList selezionato es colName + Private m_SelColumns As EgtDataGridColumn + Public Property SelColumns As EgtDataGridColumn + Get + Return m_SelColumns + End Get + Set(value As EgtDataGridColumn) + m_SelColumns = value + End Set + End Property + + 'Visualizza Sezione ed Immagine solo se fa parte di DG_Statistics_PART + Private m_vRawPartVisibility As Visibility + Public ReadOnly Property vRawPartVisibility As Visibility + Get + Return m_vRawPartVisibility + End Get + End Property + + 'Check Box per la visualizzazione nel PDF della sezione + Private m_bSection_IsChecked As Boolean + Public Property bSection_IsChecked As Boolean + Get + Return m_bSection_IsChecked + End Get + Set(value As Boolean) + m_bSection_IsChecked = value + NotifyPropertyChanged(NameOf(bSection_IsChecked)) + WriteMainPrivateProfileString(S_PDFEDITOR, S_SECTION, If(m_bSection_IsChecked, 1, 0)) + End Set + End Property + + 'Check Box per la visualizzazione nel PDF dell' immagine + Private m_bImage_IsChecked As Boolean + Public Property bImage_IsChecked As Boolean + Get + Return m_bImage_IsChecked + End Get + Set(value As Boolean) + m_bImage_IsChecked = value + NotifyPropertyChanged(NameOf(bImage_IsChecked)) + WriteMainPrivateProfileString(S_PDFEDITOR, S_IMAGE, If(m_bImage_IsChecked, 1, 0)) + End Set + End Property + +#End Region 'FIELDS & PROPERTIES + + ' Definizione comandi + Private m_cmdMoveUpOrder As ICommand + Private m_cmdMoveDownOrder As ICommand + +#Region "CONTRUCTORS" + + Sub New(TypeTable As String) + GetPrivateProfileColumns(TypeTable, m_RawPartColumns) + m_vRawPartVisibility = If(TypeTable = S_STATISTICS_PART, Visibility.Visible, Visibility.Collapsed) + m_bSection_IsChecked = GetMainPrivateProfileInt(S_PDFEDITOR, S_SECTION, 0) <> 0 + m_bImage_IsChecked = GetMainPrivateProfileInt(S_PDFEDITOR, S_IMAGE, 0) <> 0 + End Sub + +#End Region 'CONTRUCTORS + +#Region "COMMANDS" + +#Region "MoveUpOrder" + + Public ReadOnly Property MoveUpOrder_Command As ICommand + Get + If m_cmdMoveUpOrder Is Nothing Then + m_cmdMoveUpOrder = New Command(AddressOf MoveUpOrder) + End If + Return m_cmdMoveUpOrder + End Get + End Property + + Public Sub MoveUpOrder() + If IsNothing(m_RawPartColumns) Then Return + Dim nIndex As Integer = m_RawPartColumns.IndexOf(m_SelColumns) + If nIndex < 0 Then Return + If nIndex > 0 Then m_RawPartColumns.Move(nIndex, nIndex - 1) + End Sub + +#End Region ' MoveUpOrder + +#Region "MoveDownOrder" + + Public ReadOnly Property MoveDownOrder_Command As ICommand + Get + If m_cmdMoveDownOrder Is Nothing Then + m_cmdMoveDownOrder = New Command(AddressOf MoveDownOrder) + End If + Return m_cmdMoveDownOrder + End Get + End Property + + Public Sub MoveDownOrder() + If IsNothing(m_RawPartColumns) Then Return + Dim nIndex As Integer = m_RawPartColumns.IndexOf(m_SelColumns) + If nIndex < 0 Then Return + If nIndex < m_RawPartColumns.Count - 1 Then m_RawPartColumns.Move(nIndex, nIndex + 1) + End Sub + +#End Region ' MoveDownOrder + +#End Region ' COMMANDS + +End Class \ No newline at end of file diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb index 15643f21..7a757951 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb @@ -14,6 +14,9 @@ Module PDFHelper PART = 1 MACHGROUP = 2 RAWPART = 3 + MACHGROUPTOT = 4 + PART_LIST = 5 + PART_TOT = 6 End Enum Private m_TestText As String = "Testo di prova per testare MigraDoc nuget package" @@ -68,36 +71,87 @@ Module PDFHelper Public Sub DefinePartTotals(ByVal document As Document) Dim section As Section = document.AddSection() + 'Logo + document.DefaultPageSetup.DifferentFirstPageHeaderFooter = True + Dim sImageLogo As String = Map.refMainWindowVM.MainWindowM.sTempDir & "/Image" & "Logo landscape" & ".png" + DefineLogo(section, sImageLogo) ' cambio orientamento a orizzontale Dim pgSetup As PageSetup = document.DefaultPageSetup.Clone() pgSetup.Orientation = Orientation.Landscape section.PageSetup = pgSetup Dim paragraph As Paragraph = section.AddParagraph("Part Totals", "Heading2") - paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotParts_Msg & Map.refProjectVM.BTLStructureVM.sBTLTotParts) - paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotVolume_Msg & Map.refProjectVM.BTLStructureVM.sBTLTotVolume) - paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotTime_Msg & Map.refProjectVM.BTLStructureVM.sBTLTotTime) - paragraph = section.AddParagraph(Map.refStatisticsVM.BTLRemainingTime_Msg & Map.refProjectVM.BTLStructureVM.sBTLRemainingTime) + paragraph.Format.SpaceBefore = "3.0cm" + Dim sPartTot As ExpanderPDF = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61734)) + Dim sBTLTotParts As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61716)) + Dim sBTLTotVolume As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61717)) + Dim sBTLTotTime As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61718)) + Dim sBTLRemainingTime As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61720)) + If sBTLTotParts.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotParts_Msg & Map.refProjectVM.BTLStructureVM.sBTLTotParts) + If sBTLTotVolume.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotVolume_Msg & Map.refProjectVM.BTLStructureVM.sBTLTotVolume) + If sBTLTotTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotTime_Msg & Map.refProjectVM.BTLStructureVM.sBTLTotTime) + If sBTLRemainingTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLRemainingTime_Msg & Map.refProjectVM.BTLStructureVM.sBTLRemainingTime) End Sub Public Sub DefineMachGroupTotals(ByVal document As Document) Dim section As Section = document.AddSection() + 'Logo + document.DefaultPageSetup.DifferentFirstPageHeaderFooter = True + Dim sImageLogo As String = Map.refMainWindowVM.MainWindowM.sTempDir & "/Image" & "Logo landscape" & ".png" + DefineLogo(section, sImageLogo) ' cambio orientamento a orizzontale Dim pgSetup As PageSetup = document.DefaultPageSetup.Clone() pgSetup.Orientation = Orientation.Landscape section.PageSetup = pgSetup Dim paragraph As Paragraph = section.AddParagraph("Machgroup Totals", "Heading2") - paragraph = section.AddParagraph(Map.refStatisticsVM.TotMachGroups_Msg & Map.refProjectVM.MachGroupPanelVM.sTotMachGroups) - paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotVolume_Msg & Map.refProjectVM.MachGroupPanelVM.sTotVolume) - paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotEstimatedTime_Msg & Map.refProjectVM.MachGroupPanelVM.sTotEstimatedTime) - paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotTime_Msg & Map.refProjectVM.MachGroupPanelVM.sTotTime) - paragraph = section.AddParagraph(Map.refStatisticsVM.BTLRemainingTime_Msg & Map.refProjectVM.MachGroupPanelVM.sRemainingTime) - paragraph = section.AddParagraph(Map.refStatisticsVM.TotCNTParts_Msg & Map.refProjectVM.BTLStructureVM.sTotCNTParts) - paragraph = section.AddParagraph(Map.refStatisticsVM.TotADDEDParts_Msg & Map.refProjectVM.BTLStructureVM.sTotADDEDParts) - paragraph = section.AddParagraph(Map.refStatisticsVM.TotINPRODParts_Msg & Map.refProjectVM.BTLStructureVM.sTotINPRODParts) - paragraph = section.AddParagraph(Map.refStatisticsVM.TotDONEParts_Msg & Map.refProjectVM.BTLStructureVM.sTotDONEParts) + paragraph.Format.SpaceBefore = "3.0cm" + Dim sMachGroup As ExpanderPDF = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61729)) + Dim sNumberBlanks As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61721)) + Dim sTotalVolume As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61717)) + Dim sEstimatedTotalTime As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61719)) + Dim sTotalTime As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61718)) + Dim sRemainingTime As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61720)) + Dim sNumberPiecesBLT As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61722)) + Dim sNumberPiecesAdded As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61723)) + Dim sNumberPiecesInsertedBlanks As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61724)) + Dim sNumberPiecesCompleted As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61725)) + If sNumberBlanks.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotMachGroups_Msg & Map.refProjectVM.MachGroupPanelVM.sTotMachGroups) + If sTotalVolume.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotVolume_Msg & Map.refProjectVM.MachGroupPanelVM.sTotVolume) + If sEstimatedTotalTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotEstimatedTime_Msg & Map.refProjectVM.MachGroupPanelVM.sTotEstimatedTime) + If sTotalTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotTime_Msg & Map.refProjectVM.MachGroupPanelVM.sTotTime) + If sRemainingTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLRemainingTime_Msg & Map.refProjectVM.MachGroupPanelVM.sRemainingTime) + If sNumberPiecesBLT.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotCNTParts_Msg & Map.refProjectVM.BTLStructureVM.sTotCNTParts) + If sNumberPiecesAdded.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotADDEDParts_Msg & Map.refProjectVM.BTLStructureVM.sTotADDEDParts) + If sNumberPiecesInsertedBlanks.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotINPRODParts_Msg & Map.refProjectVM.BTLStructureVM.sTotINPRODParts) + If sNumberPiecesCompleted.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotDONEParts_Msg & Map.refProjectVM.BTLStructureVM.sTotDONEParts) End Sub Public Sub DefineItemList(ByVal document As Document, nListType As ListTypes) + document.DefaultPageSetup.DifferentFirstPageHeaderFooter = True + Dim sMachGroupList As ExpanderTable = Nothing + If nListType = ListTypes.MACHGROUP Then + sMachGroupList = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61730)).ExpanderElementList.FirstOrDefault() + ElseIf nListType = ListTypes.RAWPART Then + sMachGroupList = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61732)).ExpanderElementList.FirstOrDefault() + ElseIf nListType = ListTypes.PART Then + sMachGroupList = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61733)).ExpanderElementList.FirstOrDefault() + End If + Dim sName As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_NAME) + Dim sW As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W) + Dim sH As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_H) + Dim sL As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L) + Dim sMaterial As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_MATERIAL) + Dim sUsage As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_USAGE) + Dim sWaste As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_WASTE) + Dim sUTime As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_UNITTIME) + Dim sQty As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_QTY) + Dim sPDN As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PDN) + Dim sDesc As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DESC) + Dim sCNT As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_CNT) + Dim sAdded As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_ADDED) + Dim sDone As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DONE) + Dim sUVolume As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_UNITVOLUME) + Dim sTVolume As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTVOLUME) + Dim sTTime As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTTIME) Dim section As Section = document.LastSection() Select Case nListType Case ListTypes.PART @@ -155,11 +209,14 @@ Module PDFHelper Dim Columnlist As ObservableCollection(Of EgtDataGridColumn) = Nothing Select Case nListType Case ListTypes.PART - Columnlist = Map.refStatisticsVM.StatisticsColumns + 'Columnlist = Map.refStatisticsVM.StatisticsColumns + Columnlist = sMachGroupList.RawPartColumns Case ListTypes.MACHGROUP - Columnlist = Map.refStatisticsVM.OptimizerStatisticsColumns + 'Columnlist = Map.refStatisticsVM.OptimizerStatisticsColumns + Columnlist = sMachGroupList.RawPartColumns Case ListTypes.RAWPART - Columnlist = Map.refStatisticsVM.RawPartStatisticsColumns + 'Columnlist = Map.refStatisticsVM.RawPartStatisticsColumns + Columnlist = sMachGroupList.RawPartColumns End Select For ColumnIndex = 0 To Columnlist.Count - 1 Select Case Columnlist(ColumnIndex).Name @@ -180,88 +237,248 @@ Module PDFHelper row.Cells(ColumnIndex).AddParagraph(MachGroupVM.Id) End If Case "colW" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.W_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sW) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dW) - ElseIf nListType = ListTypes.RAWPART Then - row.Cells(ColumnIndex).AddParagraph(RawPart.sW) + 'If PartIndex = -2 Then + ' table.AddColumn(Unit.FromCentimeter(2)) + 'ElseIf PartIndex = -1 Then + ' row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.W_Msg) + 'ElseIf nListType = ListTypes.PART Then + ' row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sW) + 'ElseIf nListType = ListTypes.MACHGROUP Then + ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dW) + 'ElseIf nListType = ListTypes.RAWPART Then + ' row.Cells(ColumnIndex).AddParagraph(RawPart.sW) + 'End If + + If nListType = ListTypes.PART AndAlso sW.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.W_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sW) + End If + ElseIf nListType = ListTypes.MACHGROUP AndAlso sW.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.W_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dW) + End If + ElseIf nListType = ListTypes.RAWPART AndAlso sW.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.W_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(RawPart.sW) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colH" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.H_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sH) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dH) - ElseIf nListType = ListTypes.RAWPART Then - row.Cells(ColumnIndex).AddParagraph(RawPart.sH) + 'If PartIndex = -2 Then + ' table.AddColumn(Unit.FromCentimeter(2)) + 'ElseIf PartIndex = -1 Then + ' row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.H_Msg) + 'ElseIf nListType = ListTypes.PART Then + ' row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sH) + 'ElseIf nListType = ListTypes.MACHGROUP Then + ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dH) + 'ElseIf nListType = ListTypes.RAWPART Then + ' row.Cells(ColumnIndex).AddParagraph(RawPart.sH) + 'End If + + If nListType = ListTypes.PART AndAlso sH.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.H_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sH) + End If + ElseIf nListType = ListTypes.MACHGROUP AndAlso sH.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.H_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dH) + End If + ElseIf nListType = ListTypes.RAWPART AndAlso sH.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.H_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(RawPart.sH) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colL" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.L_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sL) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dL) - ElseIf nListType = ListTypes.RAWPART Then - row.Cells(ColumnIndex).AddParagraph(RawPart.sL) + 'If PartIndex = -2 Then + ' table.AddColumn(Unit.FromCentimeter(2)) + 'ElseIf PartIndex = -1 Then + ' row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.L_Msg) + 'ElseIf nListType = ListTypes.PART Then + ' row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sL) + 'ElseIf nListType = ListTypes.MACHGROUP Then + ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dL) + 'ElseIf nListType = ListTypes.RAWPART Then + ' row.Cells(ColumnIndex).AddParagraph(RawPart.sL) + 'End If + + If nListType = ListTypes.PART AndAlso sL.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.L_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sL) + End If + ElseIf nListType = ListTypes.MACHGROUP AndAlso sL.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.L_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dL) + End If + ElseIf nListType = ListTypes.RAWPART AndAlso sL.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.L_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(RawPart.sL) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colDESC" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(4)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sNAM) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) + 'If PartIndex = -2 Then + ' table.AddColumn(Unit.FromCentimeter(4)) + 'ElseIf PartIndex = -1 Then + ' row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) + 'ElseIf nListType = ListTypes.PART Then + ' row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sNAM) + 'ElseIf nListType = ListTypes.MACHGROUP Then + ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) + 'End If + + If nListType = ListTypes.PART AndAlso sDesc.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(4)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sNAM) + End If + ElseIf nListType = ListTypes.MACHGROUP AndAlso sDesc.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(4)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colNAME" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(4)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sNAM) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) + 'If PartIndex = -2 Then + ' table.AddColumn(Unit.FromCentimeter(4)) + 'ElseIf PartIndex = -1 Then + ' row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) + 'ElseIf nListType = ListTypes.PART Then + ' row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sNAM) + 'ElseIf nListType = ListTypes.MACHGROUP Then + ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) + 'End If + + If nListType = ListTypes.PART AndAlso sName.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(4)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sNAM) + End If + ElseIf nListType = ListTypes.MACHGROUP AndAlso sName.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(4)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colMATERIAL" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.MAT_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sMATERIAL) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sMATERIAL) - ElseIf nListType = ListTypes.RAWPART Then - row.Cells(ColumnIndex).AddParagraph(RawPart.sMaterial) + 'If PartIndex = -2 Then + ' table.AddColumn(Unit.FromCentimeter(2)) + 'ElseIf PartIndex = -1 Then + ' row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.MAT_Msg) + 'ElseIf nListType = ListTypes.PART Then + ' row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sMATERIAL) + 'ElseIf nListType = ListTypes.MACHGROUP Then + ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sMATERIAL) + 'ElseIf nListType = ListTypes.RAWPART Then + ' row.Cells(ColumnIndex).AddParagraph(RawPart.sMaterial) + 'End If + + If nListType = ListTypes.PART AndAlso sMaterial.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.MAT_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sMATERIAL) + End If + ElseIf nListType = ListTypes.MACHGROUP AndAlso sMaterial.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.MAT_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sMATERIAL) + End If + ElseIf nListType = ListTypes.RAWPART AndAlso sMaterial.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.MAT_Msg) + ElseIf nListType = ListTypes.RAWPART Then + row.Cells(ColumnIndex).AddParagraph(RawPart.sMaterial) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colCNT" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.CNT_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sCNT) + If sCNT.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(1)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.CNT_Msg) + ElseIf nListType = ListTypes.PART Then + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sCNT) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colADDED" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.ADDED_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sADDED) + If sAdded.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(1)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.ADDED_Msg) + ElseIf nListType = ListTypes.PART Then + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sADDED) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colINPROD" If PartIndex = -2 Then @@ -272,72 +489,136 @@ Module PDFHelper row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nINPROD) End If Case "colDONE" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.DONE_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nDONE) + If sDone.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(1)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.DONE_Msg) + ElseIf nListType = ListTypes.PART Then + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nDONE) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colUSAGE" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.Used_Msg) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sUsage) + If sUsage.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.Used_Msg) + ElseIf nListType = ListTypes.MACHGROUP Then + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sUsage) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colWASTE" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.Waste_Msg) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sWaste) + If sWaste.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.Waste_Msg) + ElseIf nListType = ListTypes.MACHGROUP Then + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sWaste) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colUNITVOLUME" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.UNIT_VOLUME_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sUnitVolume) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dUnitVolume) + 'If PartIndex = -2 Then + ' table.AddColumn(Unit.FromCentimeter(2)) + 'ElseIf PartIndex = -1 Then + ' row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.UNIT_VOLUME_Msg) + 'ElseIf nListType = ListTypes.PART Then + ' row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sUnitVolume) + 'ElseIf nListType = ListTypes.MACHGROUP Then + ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dUnitVolume) + 'End If + + If nListType = ListTypes.PART AndAlso sUVolume.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.UNIT_VOLUME_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sUnitVolume) + End If + ElseIf nListType = ListTypes.MACHGROUP AndAlso sUVolume.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.UNIT_VOLUME_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dUnitVolume) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colTOTVOLUME" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.TOT_VOLUME_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sTotVolume) + If sTVolume.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.TOT_VOLUME_Msg) + ElseIf nListType = ListTypes.PART Then + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sTotVolume) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colUNITTIME" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.UNIT_TIME_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sUnitTime) - ElseIf nListType = ListTypes.MACHGROUP Then - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sUnitTime) + 'If PartIndex = -2 Then + ' table.AddColumn(Unit.FromCentimeter(2)) + 'ElseIf PartIndex = -1 Then + ' row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.UNIT_TIME_Msg) + 'ElseIf nListType = ListTypes.PART Then + ' row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sUnitTime) + 'ElseIf nListType = ListTypes.MACHGROUP Then + ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sUnitTime) + 'End If + + If nListType = ListTypes.PART AndAlso sUTime.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.UNIT_TIME_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sUnitTime) + End If + ElseIf nListType = ListTypes.MACHGROUP AndAlso sUTime.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.UNIT_TIME_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sUnitTime) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colTOTTIME" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.TOT_TIME_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sTotTime) + If sTTime.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.TOT_TIME_Msg) + ElseIf nListType = ListTypes.PART Then + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sTotTime) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colQTY" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.QTY_Msg) - ElseIf nListType = ListTypes.RAWPART Then - row.Cells(ColumnIndex).AddParagraph(RawPart.nQuantity) + If sQty.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.QTY_Msg) + ElseIf nListType = ListTypes.RAWPART Then + row.Cells(ColumnIndex).AddParagraph(RawPart.nQuantity) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If End Select Next @@ -347,6 +628,14 @@ Module PDFHelper End Sub Public Sub DefineRawPartPictures(ByVal document As Document) + document.DefaultPageSetup.DifferentFirstPageHeaderFooter = False + Dim sMachGroupList As ExpanderTable = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61731)).ExpanderElementList.FirstOrDefault() + Dim sPDN As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PDN) + Dim sW As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W) + Dim sH As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_H) + Dim sL As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L) + Dim sDesc As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DESC) + Dim sMaterial As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_MATERIAL) Dim nOrigMachGroupId As Integer = EgtGetCurrMachGroup() For Each RawPart As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList Dim section As Section = document.AddSection() @@ -366,13 +655,15 @@ Module PDFHelper Dim sImagePath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "/Image" & RawPart.Id & ".png" EgtGetImage(SM.HIDDENLINE, New Color3d(255, 255, 255), New Color3d(255, 255, 255), 3000, 1000, sImagePath) ' aggiungo immagine - section.AddParagraph(RawPart.Name) - Dim Image As Image = section.AddImage(sImagePath) - Image.LockAspectRatio = True - Image.Width = Unit.FromMillimeter(275) - Image.RelativeHorizontal = RelativeHorizontal.Page - Image.RelativeVertical = RelativeHorizontal.Page - Image.Left = 30 + If sMachGroupList.bSection_IsChecked Then section.AddParagraph(RawPart.Name) + If sMachGroupList.bImage_IsChecked Then + Dim Image As Image = section.AddImage(sImagePath) + Image.LockAspectRatio = True + Image.Width = Unit.FromMillimeter(275) + Image.RelativeHorizontal = RelativeHorizontal.Page + Image.RelativeVertical = RelativeHorizontal.Page + Image.Left = 30 + End If ' aggiungo tabella dei pezzi Dim table As Table = New Table() table.Borders.Width = 0.75 @@ -393,48 +684,69 @@ Module PDFHelper PartVM = RawPart.PartVMList(PartIndex) End If Dim Columnlist As ObservableCollection(Of EgtDataGridColumn) = Nothing - Columnlist = Map.refStatisticsVM.StatisticsColumns + 'Columnlist = Map.refStatisticsVM.StatisticsColumns + Columnlist = sMachGroupList.RawPartColumns For ColumnIndex = 0 To Columnlist.Count - 1 Select Case Columnlist(ColumnIndex).Name Case "colPDN" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1.5)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.PDN_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.nPDN) + If sPDN.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(1.5)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.PDN_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.nPDN) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colW" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.W_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sW) + If sW.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.W_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sW) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colH" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.H_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sH) + If sH.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.H_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sH) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colL" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.L_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sL) + If sL.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.L_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sL) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colDESC" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(4)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sNAM) + If sDesc.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(4)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sNAM) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colNAME" If PartIndex = -2 Then @@ -445,12 +757,16 @@ Module PDFHelper row.Cells(ColumnIndex).AddParagraph(PartVM.sNAM) End If Case "colMATERIAL" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.MAT_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sMATERIAL) + If sMaterial.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.MAT_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sMATERIAL) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If End Select Next @@ -472,6 +788,18 @@ Module PDFHelper 'paragraph = section.AddParagraph(Map.refStatisticsVM.TotDONEParts_Msg & Map.refProjectVM.BTLStructureVM.sTotDONEParts) End Sub + Public Sub DefineLogo(section As Section, sImageLogo As String) + Dim Image As MigraDoc.DocumentObjectModel.Shapes.Image = section.Headers.FirstPage.AddImage(sImageLogo) + Image.Width = Unit.FromMillimeter(250) + Image.Height = Unit.FromMillimeter(40) + Image.LockAspectRatio = True + Image.RelativeVertical = RelativeVertical.Line + Image.Top = ShapePosition.Top + Image.Left = ShapePosition.Left + Image.WrapFormat.Style = WrapStyle.Through + Image.RelativeHorizontal = RelativeHorizontal.Margin + End Sub + Private Sub DrawImage(gfx As XGraphics, sImagePath As String) Dim image As XImage = XImage.FromFile(sImagePath) Dim x As Double = (250 - image.PixelWidth * 72 / image.HorizontalResolution) / 2 diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb b/EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb index 017287ca..5aec064f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb @@ -34,6 +34,7 @@ Module Map Private m_refFeatureManagerVM As FeatureManagerVM Private m_refAddSectionXMaterialWndVM As AddSectionXMaterialWndVM Private m_refStatisticsTimePanelVM As StatisticsTimePanelVM + Private m_refPDFEditorVM As PDFEditorVM 'Private m_refOpenProjectFileDialogVM As OpenProjectFileDialogVM 'Private m_refRawPartTabVM As RawPartTabVM 'Private m_refNestingTabVM As NestingTabVM @@ -241,6 +242,13 @@ Module Map End Get End Property + + Public ReadOnly Property refPDFEditorVM As PDFEditorVM + Get + Return m_refPDFEditorVM + End Get + End Property + 'Public ReadOnly Property refOpenProjectFileDialogVM As OpenProjectFileDialogVM ' Get ' Return m_refOpenProjectFileDialogVM @@ -453,6 +461,11 @@ Module Map Return Not IsNothing(m_refStatisticsTimePanelVM) End Function + Friend Function SetRefPDFEditorVM(PDFEditorVM As PDFEditorVM) As Boolean + m_refPDFEditorVM = PDFEditorVM + Return Not IsNothing(m_refPDFEditorVM) + End Function + 'Friend Function SetRefOpenProjectFileDialogVM(OpenProjectFileDialogVM As OpenProjectFileDialogVM) As Boolean ' m_refOpenProjectFileDialogVM = OpenProjectFileDialogVM ' Return Not IsNothing(m_refOpenProjectFileDialogVM) @@ -526,6 +539,7 @@ Module Map Not IsNothing(m_refStatisticsVM) AndAlso Not IsNothing(m_refPParameterListVM) AndAlso Not IsNothing(m_refQParameterListVM) AndAlso Not IsNothing(m_refFeatureManagerVM) AndAlso Not IsNothing(m_refAddSectionXMaterialWndVM) AndAlso Not IsNothing(m_refStatisticsTimePanelVM) AndAlso + Not IsNothing(m_refPDFEditorVM) AndAlso LibMap.EndInit() End Function From f7a7b80bd001cf50d7410247536012872d68d48a Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 27 Sep 2023 16:07:13 +0200 Subject: [PATCH 002/126] Creazione preview PDF --- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 3 + .../Resources/PDFEditor/PrintPDF.png | Bin 0 -> 591 bytes .../Statistics/PDFEditorV.xaml | 291 +++++----- .../Statistics/PDFEditorVM.vb | 153 +++++- .../Statistics/PDFHelper.vb | 504 ++++++++++-------- .../Statistics/StatisticsVM.vb | 96 +++- .../Utility/Dictionary.xaml | 13 + 7 files changed, 653 insertions(+), 407 deletions(-) create mode 100644 EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/PrintPDF.png diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index 4c035ae8..53c50dc6 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -1010,6 +1010,9 @@ + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe diff --git a/EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/PrintPDF.png b/EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/PrintPDF.png new file mode 100644 index 0000000000000000000000000000000000000000..f157e9968571a363a8b3c98858305d8723e494ec GIT binary patch literal 591 zcmV-V0l8ffXDgbq4d z(m;)y8~};r0FjUn0LT|eBn}WXVZ0j5?#6@!DE5;g?Z&$^&*SGG?aE{_!GB}*-zlm@ zeS=C=Dr;rWY3sKD&~MR}*?wmzN-&j7BR zQC)4l0dOC^({)B2?ZjDG(pjRU5X;w;=tf&V6zvZH=)Ml%NLycbM(yXc%ljXT z8abn;z0=l{z#9N<7E268J5|PL>)Yb}tUaKuFHAO%r#5G_hl(`kh&?5>Qq9O)RG}_c zD}_^S{b>;GjM`mr?_Ky#L(-pcBJEEQ%P=aY9?);`=ve)JjooXB7Et?skqr`8vWf)!vtk6t#?F?_5Yv z<%tSY_RmB~X!cz!Id`A)q>18%?0m_h3W-JS<(!{>i$S=E7tdP$^S?so-Re_NDwU{I dDp5%QcnAKEs{$Z&5Xt}m002ovPDHLkV1h5R1Kj`s literal 0 HcmV?d00001 diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml index 033fa6ad..f01e6e4c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml @@ -1,11 +1,8 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb index 9ffbabe2..86578a9e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb @@ -8,7 +8,12 @@ Public Class PDFEditorVM #Region "FIELDS & PROPERTIES" - 'Lista contenente le singole categorie + Private Enum PDFPage As Integer + VIEW = 0 ' PDF Visualizzatore + MACHING = 1 ' PDF Ottimizzatore + End Enum + + ' Lista contenente le singole categorie Private m_ExpanderList As New ObservableCollection(Of ExpanderPDF) Public ReadOnly Property ExpanderList As ObservableCollection(Of ExpanderPDF) Get @@ -16,18 +21,84 @@ Public Class PDFEditorVM End Get End Property + ' PDF visualizzato come preview nella sezione PDF Editor + Private m_WebAddress As String + Public Property WebAddress As String + Get + Return m_WebAddress + End Get + Set(value As String) + m_WebAddress = value + NotifyPropertyChanged(NameOf(WebAddress)) + End Set + End Property + + + ' Definizione comandi + Private m_cmdCreatePDFPreviewVis As ICommand + Private m_cmdCreatePDFPreviewOtt As ICommand + #End Region Sub New() - Map.SetRefPDFEditorVM(Me) m_ExpanderList.Add(New ExpanderPDF(ListTypes.MACHGROUPTOT)) m_ExpanderList.Add(New ExpanderPDF(ListTypes.MACHGROUP)) m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_LIST)) m_ExpanderList.Add(New ExpanderPDF(ListTypes.RAWPART)) m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_TOT)) m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART)) + m_WebAddress = "about:blank" ' Pagina vuota + Map.SetRefPDFEditorVM(Me) End Sub +#Region "COMMANDS" + +#Region "CreatePreviewVis" + + Public ReadOnly Property CreatePreviewVis_Command As ICommand + Get + If m_cmdCreatePDFPreviewVis Is Nothing Then + m_cmdCreatePDFPreviewVis = New Command(AddressOf CreatePreviewVis) + End If + Return m_cmdCreatePDFPreviewVis + End Get + End Property + + ''' + ''' Funzione per la visualizzazione della preview del PDF della sezione visualizzatore + ''' + Public Sub CreatePreviewVis() + Map.refStatisticsVM.CreatePrintPDF(PDFPage.VIEW, True) + m_WebAddress = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics - Visualization.pdf" + NotifyPropertyChanged(NameOf(WebAddress)) + End Sub + +#End Region ' CreatePreviewVis + +#Region "CreatePreviewOt" + + Public ReadOnly Property CreatePreviewOtt_Command As ICommand + Get + If m_cmdCreatePDFPreviewOtt Is Nothing Then + m_cmdCreatePDFPreviewOtt = New Command(AddressOf CreatePreviewOtt) + End If + Return m_cmdCreatePDFPreviewOtt + End Get + End Property + + ''' + ''' Funzione per la visualizzazione della preview del PDF della sezione ottimizzatore + ''' + Public Sub CreatePreviewOtt() + Map.refStatisticsVM.CreatePrintPDF(PDFPage.MACHING, True) + m_WebAddress = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics - Optimizer.pdf" + NotifyPropertyChanged(NameOf(WebAddress)) + End Sub + +#End Region ' CreatePreviewVis + +#End Region ' Commands + End Class Public Class ExpanderPDF @@ -61,34 +132,34 @@ Public Class ExpanderPDF Sub New(nListType As Integer) Select Case nListType Case ListTypes.MACHGROUPTOT - m_sNameCategory = EgtMsg(61729) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61721))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61717))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61719))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61718))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61720))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61722))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61723))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61724))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61725))) + m_sNameCategory = EgtMsg(61729) ' Titolo Categoria: MachGroup Totals + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61721))) ' Numero di grezzi + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61717))) ' Volume totale + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61719))) ' Tempo totole stimato + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61718))) ' Tempo totale + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61720))) ' Tempo rimanente + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61722))) ' Numero di pezzi da BTL + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61723))) ' Numero di pezzi aggiunti + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61724))) ' Numero di pezzi inseriti nei grezzi + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61725))) ' Numero di pezzi completati Case ListTypes.MACHGROUP - m_sNameCategory = EgtMsg(61730) - m_ExpanderElementList.Add(New ExpanderTable(S_OPTIMIZERSTATISTICS)) + m_sNameCategory = EgtMsg(61730) ' Titolo Categoria: MachGroup List + m_ExpanderElementList.Add(New ExpanderTable(S_OPTIMIZERSTATISTICS)) ' Tabella MachGroupList Case ListTypes.PART_LIST - m_sNameCategory = EgtMsg(61731) - m_ExpanderElementList.Add(New ExpanderTable(S_STATISTICS_PART)) + m_sNameCategory = EgtMsg(61731) ' Titolo Categoria: Raw Part + m_ExpanderElementList.Add(New ExpanderTable(S_STATISTICS_PART)) ' Tabella RawPart + Sezione e Immagine Case ListTypes.RAWPART - m_sNameCategory = EgtMsg(61732) - m_ExpanderElementList.Add(New ExpanderTable(S_RAWPARTSTATISTICS)) + m_sNameCategory = EgtMsg(61732) ' Titolo Categoria: RawPart List + m_ExpanderElementList.Add(New ExpanderTable(S_RAWPARTSTATISTICS)) ' Tabella RawPartList Case ListTypes.PART_TOT - m_sNameCategory = EgtMsg(61734) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61716))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61717))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61718))) - m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61720))) + m_sNameCategory = EgtMsg(61734) ' Titolo Categoria: Part Totals + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61716))) ' Numero totale di pezzi + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61717))) ' Volume totale + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61718))) ' Tempo totale + m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61720))) ' Tempo rimanente Case ListTypes.PART - m_sNameCategory = EgtMsg(61733) - m_ExpanderElementList.Add(New ExpanderTable(S_STATISTICS)) + m_sNameCategory = EgtMsg(61733) ' Titolo Categoria: Part List + m_ExpanderElementList.Add(New ExpanderTable(S_STATISTICS)) ' Tabella PartList End Select End Sub @@ -223,6 +294,9 @@ Public Class ExpanderTable End Get End Property + ''' + ''' Funzione per spostare in alto la colonna + ''' Public Sub MoveUpOrder() If IsNothing(m_RawPartColumns) Then Return Dim nIndex As Integer = m_RawPartColumns.IndexOf(m_SelColumns) @@ -243,6 +317,9 @@ Public Class ExpanderTable End Get End Property + ''' + ''' Funzione per spostare in basso la colonna + ''' Public Sub MoveDownOrder() If IsNothing(m_RawPartColumns) Then Return Dim nIndex As Integer = m_RawPartColumns.IndexOf(m_SelColumns) @@ -254,4 +331,30 @@ Public Class ExpanderTable #End Region ' COMMANDS +End Class + + +' Classe gestione binding Web browser +Public Class WebBrowserUtility + + Public Shared ReadOnly BindableSourceProperty As DependencyProperty = DependencyProperty.RegisterAttached("BindableSource", + GetType(String), + GetType(WebBrowserUtility), + New UIPropertyMetadata(Nothing, AddressOf BindableSourcePropertyChanged)) + + Public Shared Function GetBindableSource(obj As DependencyObject) As String + Return DirectCast(obj.GetValue(BindableSourceProperty), String) + End Function + + Public Shared Sub SetBindableSource(obj As DependencyObject, value As String) + obj.SetValue(BindableSourceProperty, value) + End Sub + + Public Shared Sub BindableSourcePropertyChanged(o As DependencyObject, e As DependencyPropertyChangedEventArgs) + Dim browser As WebBrowser = TryCast(o, WebBrowser) + If browser IsNot Nothing Then + Dim uri As String = TryCast(e.NewValue, String) + browser.Source = If(uri IsNot Nothing, New Uri(uri), Nothing) + End If + End Sub End Class \ No newline at end of file diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb index 7a757951..31df9311 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb @@ -39,119 +39,119 @@ Module PDFHelper ' Return document 'End Function - Public Function CreateStatReport(ActivePage As Pages) As Document + Public Function CreateStatReport(ActivePage As Pages, bPreview As Boolean) As Document ' creo nuovo documento MigraDoc Dim document As Document = New Document() Dim Project As ProjectFileVM = Map.refProdManagerVM.CurrProd - Select Case ActivePage - Case Pages.VIEW - Project = Map.refProjManagerVM.CurrProj - document.Info.Title = Project.sProjId & " - " & Project.BTLFileName_Msg & " - Statistics" - Case Pages.MACHINING - Project = Map.refProdManagerVM.CurrProd - document.Info.Title = Project.sProdId & " - " & Project.ListName_Msg & " - Statistics" - End Select + If bPreview Then + document.Info.Title = "135 - TestProject - Statistics" + Else + Select Case ActivePage + Case Pages.VIEW + Project = Map.refProjManagerVM.CurrProj + document.Info.Title = Project.sProjId & " - " & Project.BTLFileName_Msg & " - Statistics" + Case Pages.MACHINING + Project = Map.refProdManagerVM.CurrProd + document.Info.Title = Project.sProdId & " - " & Project.ListName_Msg & " - Statistics" + End Select + End If document.Info.Subject = "Production statistics of the project" document.Info.Author = "EgtBEAMWALL" DefineStyles(document) + 'Logo + Dim section As Section = document.AddSection() + document.DefaultPageSetup.DifferentFirstPageHeaderFooter = True + Dim sImageLogo As String = Map.refMainWindowVM.MainWindowM.sTempDir & "/Image" & "Logo landscape" & ".png" + DefineLogo(section, sImageLogo) Select Case ActivePage Case Pages.VIEW - DefinePartTotals(document) - DefineItemList(document, ListTypes.PART) + DefinePartTotals(document, section, bPreview) + DefineItemList(document, ListTypes.PART, bPreview) Case Pages.MACHINING - DefineMachGroupTotals(document) - DefineItemList(document, ListTypes.MACHGROUP) - DefineItemList(document, ListTypes.RAWPART) + DefineMachGroupTotals(document, section, bPreview) + DefineItemList(document, ListTypes.MACHGROUP, bPreview) + DefineItemList(document, ListTypes.RAWPART, bPreview) If True Then - DefineRawPartPictures(document) + CreateRawPartPages(document, bPreview) End If End Select Return document End Function - Public Sub DefinePartTotals(ByVal document As Document) - Dim section As Section = document.AddSection() - 'Logo - document.DefaultPageSetup.DifferentFirstPageHeaderFooter = True - Dim sImageLogo As String = Map.refMainWindowVM.MainWindowM.sTempDir & "/Image" & "Logo landscape" & ".png" - DefineLogo(section, sImageLogo) - ' cambio orientamento a orizzontale + Public Sub DefinePartTotals(document As Document, section As Section, bPreview As Boolean) Dim pgSetup As PageSetup = document.DefaultPageSetup.Clone() pgSetup.Orientation = Orientation.Landscape section.PageSetup = pgSetup Dim paragraph As Paragraph = section.AddParagraph("Part Totals", "Heading2") paragraph.Format.SpaceBefore = "3.0cm" - Dim sPartTot As ExpanderPDF = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61734)) - Dim sBTLTotParts As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61716)) - Dim sBTLTotVolume As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61717)) - Dim sBTLTotTime As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61718)) - Dim sBTLRemainingTime As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61720)) - If sBTLTotParts.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotParts_Msg & Map.refProjectVM.BTLStructureVM.sBTLTotParts) - If sBTLTotVolume.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotVolume_Msg & Map.refProjectVM.BTLStructureVM.sBTLTotVolume) - If sBTLTotTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotTime_Msg & Map.refProjectVM.BTLStructureVM.sBTLTotTime) - If sBTLRemainingTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLRemainingTime_Msg & Map.refProjectVM.BTLStructureVM.sBTLRemainingTime) + Dim sPartTot As ExpanderPDF = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61734)) ' Recupero lista Part Totals + Dim sBTLTotParts As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61716)) ' Recupero Numero totale pezzi con relativo checkbox + Dim sBTLTotVolume As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61717)) ' Recupero Volume totale con relativo checkbox + Dim sBTLTotTime As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61718)) ' Recupero Tempo totale con relativo checkbox + Dim sBTLRemainingTime As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61720)) ' Recupero Tempo rimanente con relativo checkbox + If sBTLTotParts.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotParts_Msg & If(Not bPreview, Map.refProjectVM.BTLStructureVM.sBTLTotParts, "")) + If sBTLTotVolume.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotVolume_Msg & If(Not bPreview, Map.refProjectVM.BTLStructureVM.sBTLTotVolume, "")) + If sBTLTotTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotTime_Msg & If(Not bPreview, Map.refProjectVM.BTLStructureVM.sBTLTotTime, "")) + If sBTLRemainingTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLRemainingTime_Msg & If(Not bPreview, Map.refProjectVM.BTLStructureVM.sBTLRemainingTime, "")) End Sub - Public Sub DefineMachGroupTotals(ByVal document As Document) - Dim section As Section = document.AddSection() - 'Logo - document.DefaultPageSetup.DifferentFirstPageHeaderFooter = True - Dim sImageLogo As String = Map.refMainWindowVM.MainWindowM.sTempDir & "/Image" & "Logo landscape" & ".png" - DefineLogo(section, sImageLogo) + Public Sub DefineMachGroupTotals(ByVal document As Document, section As Section, bPreview As Boolean) + 'Dim section As Section = document.AddSection() ' cambio orientamento a orizzontale Dim pgSetup As PageSetup = document.DefaultPageSetup.Clone() pgSetup.Orientation = Orientation.Landscape section.PageSetup = pgSetup Dim paragraph As Paragraph = section.AddParagraph("Machgroup Totals", "Heading2") paragraph.Format.SpaceBefore = "3.0cm" - Dim sMachGroup As ExpanderPDF = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61729)) - Dim sNumberBlanks As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61721)) - Dim sTotalVolume As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61717)) - Dim sEstimatedTotalTime As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61719)) - Dim sTotalTime As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61718)) - Dim sRemainingTime As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61720)) - Dim sNumberPiecesBLT As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61722)) - Dim sNumberPiecesAdded As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61723)) - Dim sNumberPiecesInsertedBlanks As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61724)) - Dim sNumberPiecesCompleted As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61725)) - If sNumberBlanks.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotMachGroups_Msg & Map.refProjectVM.MachGroupPanelVM.sTotMachGroups) - If sTotalVolume.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotVolume_Msg & Map.refProjectVM.MachGroupPanelVM.sTotVolume) - If sEstimatedTotalTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotEstimatedTime_Msg & Map.refProjectVM.MachGroupPanelVM.sTotEstimatedTime) - If sTotalTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotTime_Msg & Map.refProjectVM.MachGroupPanelVM.sTotTime) - If sRemainingTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLRemainingTime_Msg & Map.refProjectVM.MachGroupPanelVM.sRemainingTime) - If sNumberPiecesBLT.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotCNTParts_Msg & Map.refProjectVM.BTLStructureVM.sTotCNTParts) - If sNumberPiecesAdded.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotADDEDParts_Msg & Map.refProjectVM.BTLStructureVM.sTotADDEDParts) - If sNumberPiecesInsertedBlanks.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotINPRODParts_Msg & Map.refProjectVM.BTLStructureVM.sTotINPRODParts) - If sNumberPiecesCompleted.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotDONEParts_Msg & Map.refProjectVM.BTLStructureVM.sTotDONEParts) + Dim sMachGroup As ExpanderPDF = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61729)) ' Recupero lista Machgroup Totals + Dim sNumberBlanks As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61721)) ' Recupero Numero di grezzi con relativo checkbox + Dim sTotalVolume As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61717)) ' Recupero Volume totale con relativo checkbox + Dim sEstimatedTotalTime As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61719)) ' Recupero Tempo totale stimato con relativo checkbox + Dim sTotalTime As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61718)) ' Recupero Tempo totale con relativo checkbox + Dim sRemainingTime As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61720)) ' Recupero Tempo rimanente con relativo checkbox + Dim sNumberPiecesBLT As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61722)) ' Recupero Numero di pezzi da BTL con relativo checkbox + Dim sNumberPiecesAdded As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61723)) ' Recupero Numero di pezzi aggiunti con relativo checkbox + Dim sNumberPiecesInsertedBlanks As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61724)) ' Recupero Numero di pezzi inseriti nei grezzi con relativo checkbox + Dim sNumberPiecesCompleted As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61725)) ' Recupero Numero di pezzi completati con relativo checkbox + If sNumberBlanks.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotMachGroups_Msg & If(Not bPreview, Map.refProjectVM.MachGroupPanelVM.sTotMachGroups, "")) + If sTotalVolume.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotVolume_Msg & If(Not bPreview, Map.refProjectVM.MachGroupPanelVM.sTotVolume, "")) + If sEstimatedTotalTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotEstimatedTime_Msg & If(Not bPreview, Map.refProjectVM.MachGroupPanelVM.sTotEstimatedTime, "")) + If sTotalTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLTotTime_Msg & If(Not bPreview, Map.refProjectVM.MachGroupPanelVM.sTotTime, "")) + If sRemainingTime.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.BTLRemainingTime_Msg & If(Not bPreview, Map.refProjectVM.MachGroupPanelVM.sRemainingTime, "")) + If sNumberPiecesBLT.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotCNTParts_Msg & If(Not bPreview, Map.refProjectVM.BTLStructureVM.sTotCNTParts, "")) + If sNumberPiecesAdded.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotADDEDParts_Msg & If(Not bPreview, Map.refProjectVM.BTLStructureVM.sTotADDEDParts, "")) + If sNumberPiecesInsertedBlanks.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotINPRODParts_Msg & If(Not bPreview, Map.refProjectVM.BTLStructureVM.sTotINPRODParts, "")) + If sNumberPiecesCompleted.bParameter_IsChecked Then paragraph = section.AddParagraph(Map.refStatisticsVM.TotDONEParts_Msg & If(Not bPreview, Map.refProjectVM.BTLStructureVM.sTotDONEParts, "")) End Sub - Public Sub DefineItemList(ByVal document As Document, nListType As ListTypes) + Public Sub DefineItemList(ByVal document As Document, nListType As ListTypes, bPreview As Boolean) document.DefaultPageSetup.DifferentFirstPageHeaderFooter = True + 'Recupero la lista delle colonne delle tabelle Dim sMachGroupList As ExpanderTable = Nothing If nListType = ListTypes.MACHGROUP Then - sMachGroupList = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61730)).ExpanderElementList.FirstOrDefault() + sMachGroupList = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61730)).ExpanderElementList.FirstOrDefault() ' Lista Tabella MachGroup List ElseIf nListType = ListTypes.RAWPART Then - sMachGroupList = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61732)).ExpanderElementList.FirstOrDefault() + sMachGroupList = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61732)).ExpanderElementList.FirstOrDefault() ' Lista Tabella Raw Part List ElseIf nListType = ListTypes.PART Then - sMachGroupList = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61733)).ExpanderElementList.FirstOrDefault() + sMachGroupList = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61733)).ExpanderElementList.FirstOrDefault() ' Lista Tabella Part List End If - Dim sName As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_NAME) - Dim sW As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W) - Dim sH As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_H) - Dim sL As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L) - Dim sMaterial As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_MATERIAL) - Dim sUsage As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_USAGE) - Dim sWaste As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_WASTE) - Dim sUTime As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_UNITTIME) - Dim sQty As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_QTY) - Dim sPDN As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PDN) - Dim sDesc As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DESC) - Dim sCNT As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_CNT) - Dim sAdded As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_ADDED) - Dim sDone As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DONE) - Dim sUVolume As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_UNITVOLUME) - Dim sTVolume As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTVOLUME) - Dim sTTime As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTTIME) + Dim sName As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_NAME) ' Recupero colonna 'colName' con relativo checkbox + Dim sW As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W) ' Recupero colonna 'colW' con relativo checkbox + Dim sH As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_H) ' Recupero colonna 'colH' con relativo checkbox + Dim sL As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L) ' Recupero colonna 'colL' con relativo checkbox + Dim sMaterial As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_MATERIAL) ' Recupero colonna 'colMaterial' con relativo checkbox + Dim sUsage As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_USAGE) ' Recupero colonna 'colUsage' con relativo checkbox + Dim sWaste As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_WASTE) ' Recupero colonna 'colWaste' con relativo checkbox + Dim sUTime As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_UNITTIME) ' Recupero colonna 'colUnitTime' con relativo checkbox + Dim sQty As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_QTY) ' Recupero colonna 'colQuantity' con relativo checkbox + Dim sPDN As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PDN) ' Recupero colonna 'colPDN' con relativo checkbox + Dim sDesc As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DESC) ' Recupero colonna 'colDescription' con relativo checkbox + Dim sCNT As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_CNT) ' Recupero colonna 'colCNT' con relativo checkbox + Dim sAdded As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_ADDED) ' Recupero colonna 'colAdded' con relativo checkbox + Dim sDone As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DONE) ' Recupero colonna 'colDone' con relativo checkbox + Dim sUVolume As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_UNITVOLUME) ' Recupero colonna 'colUnitVolume' con relativo checkbox + Dim sTVolume As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTVOLUME) ' Recupero colonna 'colTotVolume' con relativo checkbox + Dim sTTime As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTTIME) ' Recupero colonna 'colTotTime' con relativo checkbox Dim section As Section = document.LastSection() Select Case nListType Case ListTypes.PART @@ -168,14 +168,19 @@ Module PDFHelper ' -1 -> riempio colonne della riga degli header ' >=0 -> riempio le colonne con i valori dei pezzi Dim Itemlist As IEnumerable(Of Object) = Nothing - Select Case nListType - Case ListTypes.PART - Itemlist = Map.refProjectVM.BTLStructureVM.BTLPartVMList - Case ListTypes.MACHGROUP - Itemlist = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - Case ListTypes.RAWPART - Itemlist = Map.refStatisticsVM.RawPartList - End Select + ' Controllo se bPreview è true mostra il PDF di preview se no il PDF completo + If bPreview Then + Itemlist = New List(Of Object) + Else + Select Case nListType + Case ListTypes.PART + Itemlist = Map.refProjectVM.BTLStructureVM.BTLPartVMList + Case ListTypes.MACHGROUP + Itemlist = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList + Case ListTypes.RAWPART + Itemlist = Map.refStatisticsVM.RawPartList + End Select + End If 'If m_ActivePage = Pages.VIEW Then ' Itemlist = Map.refProjectVM.BTLStructureVM.BTLPartVMList.ToList() 'ElseIf m_ActivePage = Pages.MACHINING Then @@ -221,12 +226,16 @@ Module PDFHelper For ColumnIndex = 0 To Columnlist.Count - 1 Select Case Columnlist(ColumnIndex).Name Case "colPDN" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1.5)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.PDN_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nPDN) + If sPDN.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(1.5)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.PDN_Msg) + ElseIf nListType = ListTypes.PART Then + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nPDN) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If Case "colID" If PartIndex = -2 Then @@ -627,154 +636,25 @@ Module PDFHelper document.LastSection.Add(table) End Sub - Public Sub DefineRawPartPictures(ByVal document As Document) + Public Sub CreateRawPartPages(ByVal document As Document, bPreview As Boolean) document.DefaultPageSetup.DifferentFirstPageHeaderFooter = False - Dim sMachGroupList As ExpanderTable = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61731)).ExpanderElementList.FirstOrDefault() - Dim sPDN As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PDN) - Dim sW As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W) - Dim sH As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_H) - Dim sL As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L) - Dim sDesc As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DESC) - Dim sMaterial As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_MATERIAL) + 'Recupero la lista delle colonne delle tabelle + Dim sMachGroupList As ExpanderTable = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61731)).ExpanderElementList.FirstOrDefault() ' Lista Tabella Raw Part + Dim sPDN As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PDN) ' Recupero colonna 'colPDN' con relativo checkbox + Dim sW As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W) ' Recupero colonna 'colW' con relativo checkbox + Dim sH As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_H) ' Recupero colonna 'colH' con relativo checkbox + Dim sL As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L) ' Recupero colonna 'colL' con relativo checkbox + Dim sDesc As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DESC) ' Recupero colonna 'colDescription' con relativo checkbox + Dim sMaterial As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_MATERIAL) ' Recupero colonna 'colMaterial' con relativo checkbox Dim nOrigMachGroupId As Integer = EgtGetCurrMachGroup() - For Each RawPart As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - Dim section As Section = document.AddSection() - ' cambio orientamento a verticale - Dim pgSetup As PageSetup = document.DefaultPageSetup.Clone() - pgSetup.Orientation = Orientation.Landscape - section.PageSetup = pgSetup - ' creo immagine - EgtSetCurrMachGroup(RawPart.Id) - 'If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then - ' EgtSetView(VT.FRONT, False) - 'Else - ' EgtSetView(VT.TOP, False) - 'End If - Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.FRONT, VT.TOP), False) - EgtZoom(ZM.ALL, False) - Dim sImagePath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "/Image" & RawPart.Id & ".png" - EgtGetImage(SM.HIDDENLINE, New Color3d(255, 255, 255), New Color3d(255, 255, 255), 3000, 1000, sImagePath) - ' aggiungo immagine - If sMachGroupList.bSection_IsChecked Then section.AddParagraph(RawPart.Name) - If sMachGroupList.bImage_IsChecked Then - Dim Image As Image = section.AddImage(sImagePath) - Image.LockAspectRatio = True - Image.Width = Unit.FromMillimeter(275) - Image.RelativeHorizontal = RelativeHorizontal.Page - Image.RelativeVertical = RelativeHorizontal.Page - Image.Left = 30 - End If - ' aggiungo tabella dei pezzi - Dim table As Table = New Table() - table.Borders.Width = 0.75 - For PartIndex = -2 To RawPart.PartVMList.Count - 1 - Dim PartVM As PartVM = Nothing - Dim row As Row = Nothing - If PartIndex <> -2 Then - ' aggiungo riga - row = table.AddRow() - End If - If PartIndex = -1 Then - ' imposto la riga come header che si ripetera' all'inizio di ogni pagina - row.HeadingFormat = True - ' coloro sfondo riga degli header - row.Shading.Color = Colors.Aqua - ElseIf PartIndex >= 0 Then - ' recupero elemento della riga - PartVM = RawPart.PartVMList(PartIndex) - End If - Dim Columnlist As ObservableCollection(Of EgtDataGridColumn) = Nothing - 'Columnlist = Map.refStatisticsVM.StatisticsColumns - Columnlist = sMachGroupList.RawPartColumns - For ColumnIndex = 0 To Columnlist.Count - 1 - Select Case Columnlist(ColumnIndex).Name - Case "colPDN" - If sPDN.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1.5)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.PDN_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.nPDN) - End If - ElseIf PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(0)) - End If - Case "colW" - If sW.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.W_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sW) - End If - ElseIf PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(0)) - End If - Case "colH" - If sH.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.H_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sH) - End If - ElseIf PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(0)) - End If - Case "colL" - If sL.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.L_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sL) - End If - ElseIf PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(0)) - End If - Case "colDESC" - If sDesc.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(4)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sNAM) - End If - ElseIf PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(0)) - End If - Case "colNAME" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(4)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sNAM) - End If - Case "colMATERIAL" - If sMaterial.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.MAT_Msg) - Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sMATERIAL) - End If - ElseIf PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(0)) - End If - End Select - Next + ' Controllo se bPreview è true mostra il PDF di preview se no il PDF completo + If bPreview Then + CreateRawPartPage(document, sMachGroupList, sPDN, sW, sH, sL, sDesc, sMaterial, Nothing) + Else + For Each RawPart As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList + CreateRawPartPage(document, sMachGroupList, sPDN, sW, sH, sL, sDesc, sMaterial, RawPart) Next - ' aggiungo tabella all'ultima sezione - section.Add(table) - - Next + End If 'Dim paragraph As Paragraph = section.AddParagraph("Machgroup Totals", "Heading2") 'paragraph = section.AddParagraph(Map.refStatisticsVM.TotMachGroups_Msg & Map.refProjectVM.MachGroupPanelVM.sTotMachGroups) @@ -788,9 +668,159 @@ Module PDFHelper 'paragraph = section.AddParagraph(Map.refStatisticsVM.TotDONEParts_Msg & Map.refProjectVM.BTLStructureVM.sTotDONEParts) End Sub + Private Sub CreateRawPartPage(document As Document, sMachGroupList As ExpanderTable, sPDN As EgtDataGridColumn, sW As EgtDataGridColumn, sH As EgtDataGridColumn, sL As EgtDataGridColumn, sDesc As EgtDataGridColumn, sMaterial As EgtDataGridColumn, RawPart As MyMachGroupVM) + Dim section As Section = document.AddSection() + ' cambio orientamento a verticale + Dim pgSetup As PageSetup = document.DefaultPageSetup.Clone() + pgSetup.Orientation = Orientation.Landscape + section.PageSetup = pgSetup + Dim PartVMList As IEnumerable(Of Object) + If IsNothing(RawPart) Then + PartVMList = New List(Of Object) + CreateRawPartImage(section, sMachGroupList, 1, 1) + Else + PartVMList = RawPart.PartVMList + CreateRawPartImage(section, sMachGroupList, RawPart.Id, RawPart.Name) + End If + + ' aggiungo tabella dei pezzi + Dim table As Table = New Table() + table.Borders.Width = 0.75 + For PartIndex = -2 To PartVMList.Count - 1 + Dim PartVM As PartVM = Nothing + Dim row As Row = Nothing + If PartIndex <> -2 Then + ' aggiungo riga + row = table.AddRow() + End If + If PartIndex = -1 Then + ' imposto la riga come header che si ripetera' all'inizio di ogni pagina + row.HeadingFormat = True + ' coloro sfondo riga degli header + row.Shading.Color = Colors.Aqua + ElseIf PartIndex >= 0 Then + ' recupero elemento della riga + PartVM = PartVMList(PartIndex) + End If + Dim Columnlist As ObservableCollection(Of EgtDataGridColumn) = Nothing + 'Columnlist = Map.refStatisticsVM.StatisticsColumns + Columnlist = sMachGroupList.RawPartColumns + For ColumnIndex = 0 To Columnlist.Count - 1 + Select Case Columnlist(ColumnIndex).Name + Case "colPDN" + If sPDN.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(1.5)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.PDN_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.nPDN) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) + End If + Case "colW" + If sW.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.W_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sW) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) + End If + Case "colH" + If sH.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.H_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sH) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) + End If + Case "colL" + If sL.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.L_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sL) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) + End If + Case "colDESC" + If sDesc.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(4)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sNAM) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) + End If + Case "colNAME" + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(4)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.NAM_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sNAM) + End If + Case "colMATERIAL" + If sMaterial.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(2)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.MAT_Msg) + Else + row.Cells(ColumnIndex).AddParagraph(PartVM.sMATERIAL) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) + End If + End Select + Next + Next + ' aggiungo tabella all'ultima sezione + section.Add(table) + End Sub + + Private Sub CreateRawPartImage(section As Section, sMachGroupList As ExpanderTable, RawPartId As Integer, RawPartName As String) + ' creo immagine + EgtSetCurrMachGroup(RawPartId) + 'If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then + ' EgtSetView(VT.FRONT, False) + 'Else + ' EgtSetView(VT.TOP, False) + 'End If + Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.FRONT, VT.TOP), False) + EgtZoom(ZM.ALL, False) + Dim sImagePath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "/Image" & RawPartId & ".png" + EgtGetImage(SM.HIDDENLINE, New Color3d(255, 255, 255), New Color3d(255, 255, 255), 3000, 1000, sImagePath) + ' aggiungo immagine + If sMachGroupList.bSection_IsChecked Then section.AddParagraph(RawPartName) + If sMachGroupList.bImage_IsChecked Then + Dim Image As Image = section.AddImage(sImagePath) + Image.LockAspectRatio = True + Image.Width = Unit.FromMillimeter(275) + Image.RelativeHorizontal = RelativeHorizontal.Page + Image.RelativeVertical = RelativeHorizontal.Page + Image.Left = 30 + End If + End Sub + Public Sub DefineLogo(section As Section, sImageLogo As String) Dim Image As MigraDoc.DocumentObjectModel.Shapes.Image = section.Headers.FirstPage.AddImage(sImageLogo) - Image.Width = Unit.FromMillimeter(250) + Image.Width = Unit.FromMillimeter(245) Image.Height = Unit.FromMillimeter(40) Image.LockAspectRatio = True Image.RelativeVertical = RelativeVertical.Line diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb index ae757482..9f8cd869 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb @@ -317,33 +317,26 @@ Public Class StatisticsVM End Select End Sub -#End Region ' METHODS - -#Region "COMMANDS" - -#Region "PrintPDF" - - Public ReadOnly Property PrintPDF_Command As ICommand - Get - If m_cmdPrintPDF Is Nothing Then - m_cmdPrintPDF = New Command(AddressOf PrintPDF) - End If - Return m_cmdPrintPDF - End Get - End Property - - Public Sub PrintPDF() + Public Sub CreatePrintPDF(ActivePage As Integer, bPreview As Boolean) LoadingWndHelper.OpenLoadingWnd(ActiveIds.CREATINGPDF, 1, "Creating PDF", "", 100) Try ' creo documento MigraDoc - Dim document As Document = PDFHelper.CreateStatReport(Map.refMainMenuVM.SelPage) + Dim document As Document = PDFHelper.CreateStatReport(ActivePage, bPreview) Dim documentPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\MigraDoc.mdddl" MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToFile(document, documentPath) Dim renderer As PdfDocumentRenderer = New PdfDocumentRenderer(True) renderer.Document = document renderer.RenderDocument() ' salvo il documento - Dim sFileName As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf" + Dim sFileName As String = "" + ' Controllo la pagina e se bPreview e' True + If ActivePage = 0 AndAlso bPreview Then + sFileName = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics - Visualization.pdf" ' Se la pagina e' 0 e' bPreview e' True creo PDF Visualization + ElseIf ActivePage = 1 AndAlso bPreview Then + sFileName = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics - Optimizer.pdf" ' Se la pagina e' 1 e' bPreview e' True creo PDF Optimizer + Else + sFileName = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf" ' Altrimenti se bPreview e' Falso creo PDF Statistics + End If Select Case Map.refMainMenuVM.SelPage Case Pages.VIEW sFileName = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & "Statistics.pdf" @@ -363,11 +356,15 @@ Public Class StatisticsVM EgtZoom(ZM.ALL, True) End Select + ' avvio il visualizzatore renderer.PdfDocument.Save(sFileName) ' cancello file MigraDoc File.Delete(documentPath) - ' avvio il visualizzatore - Process.Start(sFileName) + + If bPreview Then + Else + Process.Start(sFileName) + End If Catch ex As Exception EgtOutLog("Error genereting pdf: " & ex.ToString()) End Try @@ -375,6 +372,65 @@ Public Class StatisticsVM End Sub +#End Region ' METHODS + +#Region "COMMANDS" + +#Region "PrintPDF" + + Public ReadOnly Property PrintPDF_Command As ICommand + Get + If m_cmdPrintPDF Is Nothing Then + m_cmdPrintPDF = New Command(AddressOf PrintPDF) + End If + Return m_cmdPrintPDF + End Get + End Property + + Public Sub PrintPDF() + CreatePrintPDF(Map.refMainMenuVM.SelPage, False) + 'LoadingWndHelper.OpenLoadingWnd(ActiveIds.CREATINGPDF, 1, "Creating PDF", "", 100) + 'Try + ' ' creo documento MigraDoc + ' Dim document As Document = PDFHelper.CreateStatReport(Map.refMainMenuVM.SelPage, False) + ' Dim documentPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\MigraDoc.mdddl" + ' MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToFile(document, documentPath) + ' Dim renderer As PdfDocumentRenderer = New PdfDocumentRenderer(True) + ' renderer.Document = document + ' renderer.RenderDocument() + ' ' salvo il documento + ' Dim sFileName As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf" + ' Select Case Map.refMainMenuVM.SelPage + ' Case Pages.VIEW + ' sFileName = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & "Statistics.pdf" + ' Case Pages.MACHINING + ' sFileName = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & Map.refProdManagerVM.CurrProd.sProdId & " - " & "Statistics.pdf" + ' ' ripristino selezione precedente + ' Dim nCurrMachGroupId As Integer = EgtGetCurrMachGroup() + ' If Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup) AndAlso nCurrMachGroupId <> Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Id Then + ' EgtSetCurrMachGroup(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Id) + ' End If + ' 'If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then + ' ' EgtSetView(VT.ISO_SW, False) + ' 'Else + ' ' EgtSetView(VT.TOP, False) + ' 'End If + ' Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) + ' EgtZoom(ZM.ALL, True) + ' End Select + + ' renderer.PdfDocument.Save(sFileName) + ' ' cancello file MigraDoc + ' File.Delete(documentPath) + ' ' avvio il visualizzatore + ' Process.Start(sFileName) + 'Catch ex As Exception + ' EgtOutLog("Error genereting pdf: " & ex.ToString()) + 'End Try + 'LoadingWndHelper.CloseLoadingWnd(ActiveIds.CREATINGPDF) + + End Sub + #End Region ' PrintPDF #End Region ' COMMANDS diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index a81677b8..16137429 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -189,6 +189,19 @@ + + From 947c776d83807c77cbaf5202742133f163798117 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 28 Sep 2023 15:46:52 +0200 Subject: [PATCH 003/126] Migliorie grafiche preview --- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 3 + .../Resources/PDFEditor/Delete.png | Bin 0 -> 658 bytes .../Resources/PDFEditor/MoveDown.png | Bin 432 -> 499 bytes .../Resources/PDFEditor/MoveUp.png | Bin 427 -> 492 bytes .../Statistics/PDFEditorV.xaml | 94 +++++------------- .../Statistics/PDFEditorVM.vb | 76 ++++++++++---- .../Statistics/StatisticsVM.vb | 4 +- .../Utility/Dictionary.xaml | 91 ++++++++++++++++- 8 files changed, 180 insertions(+), 88 deletions(-) create mode 100644 EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/Delete.png diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index 53c50dc6..855a0e5e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -1013,6 +1013,9 @@ + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe diff --git a/EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/Delete.png b/EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/Delete.png new file mode 100644 index 0000000000000000000000000000000000000000..b90063f2f6a2cfe1e1bd4a5da4adf232fec8d036 GIT binary patch literal 658 zcmV;D0&V??P)$Tdq(NlXkI;ak+?)c~*9g>~8^9Ln2 z@=f-}`N`^Q-XcUyFC#L39gCPL98!^i7?In&NcAlHD6IvKWbL&&bZqcO6})%@7;|7-#VnS>L(!j$pD-|GIAPt0<{0S4KeN zo$3@$PD=J!a`_Eq{1fryOdOZYU$A^&)9((77Br4jypp|$&jUcKo$M(B;q=w`my%aqE=6)$+*`G(w4d zMAo2j^BDT?%s%hvm6|%Z439ddAbSd(6x}hZ*0oY2W68ne}@(AL91JD@C zsd!snL%JWO*WjtOq4JebX!{;U{jIsTe1&m7iMhlUGTDZ~4Zm#R2VF s)NV6eK3}11Yv}I(sSfHtKz$1^04xjNcntC5R{#J207*qoM6N<$f*@`o^Z)<= literal 0 HcmV?d00001 diff --git a/EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/MoveDown.png b/EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/MoveDown.png index 62f9173fd634adf1653678945ce24dc5710130ac..e2391dd930de30b6c5e1592348fd5f2cc6189ed9 100644 GIT binary patch delta 473 zcmV;~0Ve*i1M>rrB!2;OQb$4nuFf3k00004XF*Lt006O%3;baP00009a7bBm000XS z000XS0e@s)kpKVzh)G02R9Hvtm%&lPFc3uz6;J^sqy^Fexo{>WBqh*6QUT=51v-EZ z0u=xiKn3Q1?P8pfqpV~plY`!jN7}@azgO!o`>bu-=F~XX_J5?PqO4R=R;nl~oli|3 zzb?=`;9y&dEsk&LdaT}WF5Q1S<_TeQH1`r6l{Ew{w7)BgKp3-iE74JSg`lbS9YZxm z#c$Fr&JT{6bpP>0>AG?mIiNJtzdGtO`1IjK7G$@^g;?r!JoZ`w2C%l)5@lzD`B&Qa z2>KKTmZ&ez7k^xZpeTifn5(`x&m1?q&#N2U9{#`hw<4q9{Cr3}MPtkCgfvG{_K9qHwn?(5MT5nT|6Pn<)z85?bqv2FdfI zNdCk^eX(e-B^u-zf?~7kh|W|G+Qg@HJ!p{0Hj*qVP*PtegA6eyQxrxcTuRij(BG38 zC5k`*H`a|r&LFvwk7Beag&Qn){w%LM$xmNNa%CzjRg{$~%1RYwqiKEtAY69o%Wy3D P00000NkvXXu0mjfuA|Dq delta 406 zcmV;H0crm81F!>-B!3BTNLh0L01FZT01FZU(%pXi0004ENkl@oqx>5zv9WIegp85K&;PB z3HI8K^_Oo0ph_%s>(L-bWGVawe>;)X=2DKj zkUP%_3hTQPjDPg2_SySl3TtKWCqb5qD6FI$b@A#F0t;(N$x*Nr{0r;e&i5kth{dHg z-+t+sQYpb!A)g)7e23D#21VxR)MWv<+KQDV)U)BZYNm$Ag*V*v_RkVScs^ zTlBUx)xp7(iDOKTy5v7NsAMTBS&B-QA_3qRT^MwV@ekCJjQ{`u07*qoM6N<$g7E9S AN&o-= diff --git a/EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/MoveUp.png b/EgtBEAMWALL.ViewerOptimizer/Resources/PDFEditor/MoveUp.png index c6b6f17ab1c62968f1bb4c00a3ba89c40083ebb4..690b72a8d5c555d0e77eaa2f176d0d44d17d3500 100644 GIT binary patch delta 466 zcmV;@0WJQk1MCBkB!2;OQb$4nuFf3k00004XF*Lt006O%3;baP00009a7bBm000XS z000XS0e@s)kpKVzfk{L`R9Hvtmd$MfF%X3}G!QBPDhNphKn0LP&ZGkkRjk6;X|?$zZlc6r@^PB z;Y9Bg1oaW#Bs=34W2?VMky1VydnnTeV~l9yM~T8Nydcaa^D@VC^jk2&p2CNw2=9`a zn89Crotp>}rGGy8#-MMk(D)+=`;oMr(DKpPA%X~>cl{x}m_@0NCXxj+!TaXMYAPQV zTp+wkmc%2<*t%=2q9AC5z(yEaHW#MGYAIigk9=^Q*2a2Kl=^^;FehB^qQAVNAczO+ zO0w+mM&WI&PEX+l9<*$Dxyt6_!R4=pD6KaI#smG3`%te?nn=sNs5hsQ>@~07*qo IM6N<$f&@Fz&j0`b delta 401 zcmV;C0dD^61FHj&B!3BTNLh0L01FZT01FZU(%pXi00049Nklh3hp1R3<4eg=2vM>2O1T`^A{>*!VhxT@X>$j>jq7v3V_g+% zvDC;p>cd;CzsA?uXpb#q+4%D1%hWM)6k_Hp)&nW`!L~e+P)q5GdCxvm?ls!rC4UD6 vu$htUd#iST%s)7!WGN|GN=lXz0el1cH-2&DGrh(D015yANkvXXu0mjfgK)JS diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml index f01e6e4c..8f964bbb 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml @@ -1,16 +1,8 @@  + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"> - @@ -21,68 +13,54 @@ - + Style="{StaticResource GroupBox_PDFPreview}"> + + - + Style="{StaticResource ScrollViewer}"> + - + - + + Style="{StaticResource Category_TextBlock}"/> + Style="{StaticResource ItemsControl_ExpanderElementList}"> - + - + @@ -96,23 +74,15 @@ - + Style="{StaticResource ListBox}"> - + @@ -121,35 +91,26 @@ - + - - + - + Style="{StaticResource StackPanel_Button}"> @@ -164,13 +125,10 @@ - + Style="{StaticResource GroupBox_PDFPreview}"> + - diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb index 86578a9e..7fdaeb57 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb @@ -37,20 +37,25 @@ Public Class PDFEditorVM ' Definizione comandi Private m_cmdCreatePDFPreviewVis As ICommand Private m_cmdCreatePDFPreviewOtt As ICommand + Private m_cmdClosePreview As ICommand #End Region +#Region "CONSTRUCTORS" + Sub New() - m_ExpanderList.Add(New ExpanderPDF(ListTypes.MACHGROUPTOT)) - m_ExpanderList.Add(New ExpanderPDF(ListTypes.MACHGROUP)) - m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_LIST)) - m_ExpanderList.Add(New ExpanderPDF(ListTypes.RAWPART)) - m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_TOT)) - m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART)) - m_WebAddress = "about:blank" ' Pagina vuota + m_ExpanderList.Add(New ExpanderPDF(ListTypes.MACHGROUPTOT)) ' MachGroup Totals + m_ExpanderList.Add(New ExpanderPDF(ListTypes.MACHGROUP)) ' MachGroup List + m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_LIST)) ' Raw Part + m_ExpanderList.Add(New ExpanderPDF(ListTypes.RAWPART)) ' RawPart List + m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_TOT)) ' Part Totals + m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART)) ' Part List + m_WebAddress = "about:blank" ' Pagina vuota Map.SetRefPDFEditorVM(Me) End Sub +#End Region ' Constructors + #Region "COMMANDS" #Region "CreatePreviewVis" @@ -97,6 +102,27 @@ Public Class PDFEditorVM #End Region ' CreatePreviewVis +#Region "ClosePreview" + + Public ReadOnly Property ClosePreview_Command As ICommand + Get + If m_cmdClosePreview Is Nothing Then + m_cmdClosePreview = New Command(AddressOf ClosePreview) + End If + Return m_cmdClosePreview + End Get + End Property + + ''' + ''' Funzione per la chiusura della preview + ''' + Public Sub ClosePreview() + m_WebAddress = "about:blank" + NotifyPropertyChanged(NameOf(WebAddress)) + End Sub + +#End Region ' CreatePreviewVis + #End Region ' Commands End Class @@ -122,7 +148,7 @@ Public Class ExpanderPDF End Get End Property -#End Region 'FIELDS & PROPERTIES +#End Region ' FIELDS & PROPERTIES #Region "CONTRUCTORS" @@ -131,7 +157,7 @@ Public Class ExpanderPDF Sub New(nListType As Integer) Select Case nListType - Case ListTypes.MACHGROUPTOT + Case ListTypes.MACHGROUPTOT ' MachGroup Totals m_sNameCategory = EgtMsg(61729) ' Titolo Categoria: MachGroup Totals m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61721))) ' Numero di grezzi m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61717))) ' Volume totale @@ -142,28 +168,28 @@ Public Class ExpanderPDF m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61723))) ' Numero di pezzi aggiunti m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61724))) ' Numero di pezzi inseriti nei grezzi m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61725))) ' Numero di pezzi completati - Case ListTypes.MACHGROUP + Case ListTypes.MACHGROUP ' MachGroup List m_sNameCategory = EgtMsg(61730) ' Titolo Categoria: MachGroup List m_ExpanderElementList.Add(New ExpanderTable(S_OPTIMIZERSTATISTICS)) ' Tabella MachGroupList - Case ListTypes.PART_LIST + Case ListTypes.PART_LIST ' Raw Part m_sNameCategory = EgtMsg(61731) ' Titolo Categoria: Raw Part m_ExpanderElementList.Add(New ExpanderTable(S_STATISTICS_PART)) ' Tabella RawPart + Sezione e Immagine - Case ListTypes.RAWPART + Case ListTypes.RAWPART ' RawPart List m_sNameCategory = EgtMsg(61732) ' Titolo Categoria: RawPart List m_ExpanderElementList.Add(New ExpanderTable(S_RAWPARTSTATISTICS)) ' Tabella RawPartList - Case ListTypes.PART_TOT + Case ListTypes.PART_TOT ' Part Totals m_sNameCategory = EgtMsg(61734) ' Titolo Categoria: Part Totals m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61716))) ' Numero totale di pezzi m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61717))) ' Volume totale m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61718))) ' Tempo totale m_ExpanderElementList.Add(New ExpanderElement(EgtMsg(61720))) ' Tempo rimanente - Case ListTypes.PART + Case ListTypes.PART ' Part List m_sNameCategory = EgtMsg(61733) ' Titolo Categoria: Part List m_ExpanderElementList.Add(New ExpanderTable(S_STATISTICS)) ' Tabella PartList End Select End Sub -#End Region 'CONTRUCTORS +#End Region ' CONTRUCTORS End Class @@ -264,7 +290,23 @@ Public Class ExpanderTable End Set End Property -#End Region 'FIELDS & PROPERTIES +#Region "MESSAGES" + + Public ReadOnly Property Section_Msg As String + Get + Return EgtMsg(61735).ToUpper() + End Get + End Property + + Public ReadOnly Property Image_Msg As String + Get + Return EgtMsg(61736).ToUpper() + End Get + End Property + +#End Region ' Messages + +#End Region ' FIELDS & PROPERTIES ' Definizione comandi Private m_cmdMoveUpOrder As ICommand @@ -279,7 +321,7 @@ Public Class ExpanderTable m_bImage_IsChecked = GetMainPrivateProfileInt(S_PDFEDITOR, S_IMAGE, 0) <> 0 End Sub -#End Region 'CONTRUCTORS +#End Region ' CONTRUCTORS #Region "COMMANDS" diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb index 9f8cd869..1ee67114 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb @@ -324,7 +324,7 @@ Public Class StatisticsVM Dim document As Document = PDFHelper.CreateStatReport(ActivePage, bPreview) Dim documentPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\MigraDoc.mdddl" MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToFile(document, documentPath) - Dim renderer As PdfDocumentRenderer = New PdfDocumentRenderer(True) + Dim renderer As New PdfDocumentRenderer(True) renderer.Document = document renderer.RenderDocument() ' salvo il documento @@ -356,7 +356,7 @@ Public Class StatisticsVM EgtZoom(ZM.ALL, True) End Select - ' avvio il visualizzatore + ' avvio il visualizzatore renderer.PdfDocument.Save(sFileName) ' cancello file MigraDoc File.Delete(documentPath) diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index 16137429..9e6d7c3f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -187,11 +187,18 @@ + + + + @@ -704,6 +717,12 @@ + + + @@ -815,4 +834,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 7bfd834b0e58cc84931bd53fa06bfab47efd64a7 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 28 Sep 2023 17:19:38 +0200 Subject: [PATCH 004/126] Migliorie codice preview PDF --- .../Statistics/PDFEditorVM.vb | 31 ++++++++++++------- .../Statistics/PDFHelper.vb | 4 +++ .../Statistics/StatisticsVM.vb | 5 +-- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb index 7fdaeb57..c9edf18f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb @@ -33,7 +33,6 @@ Public Class PDFEditorVM End Set End Property - ' Definizione comandi Private m_cmdCreatePDFPreviewVis As ICommand Private m_cmdCreatePDFPreviewOtt As ICommand @@ -148,7 +147,7 @@ Public Class ExpanderPDF End Get End Property -#End Region ' FIELDS & PROPERTIES +#End Region ' Fields & Properties #Region "CONTRUCTORS" @@ -189,7 +188,7 @@ Public Class ExpanderPDF End Select End Sub -#End Region ' CONTRUCTORS +#End Region ' Constructors End Class @@ -219,7 +218,7 @@ Public Class ExpanderElement End Set End Property -#End Region 'FIELDS & PROPERTIES +#End Region 'Fields & Properties #Region "CONTRUCTORS" @@ -228,7 +227,7 @@ Public Class ExpanderElement m_bParameter_IsChecked = GetMainPrivateProfileInt(S_PDFEDITOR, m_sNameParameter, 0) <> 0 End Sub -#End Region 'CONTRUCTORS +#End Region 'Constructors End Class @@ -237,6 +236,8 @@ Public Class ExpanderTable #Region "FIELDS & PROPERTIES" +#Region "RAWPARTCOLUMNS" + 'Lista Colonne Tabella MachGroup List, RawPart List, PartList Private m_RawPartColumns As New ObservableCollection(Of EgtDataGridColumn) Public ReadOnly Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn) @@ -256,7 +257,11 @@ Public Class ExpanderTable End Set End Property - 'Visualizza Sezione ed Immagine solo se fa parte di DG_Statistics_PART +#End Region ' RawPartColumns + +#Region "SECTION & IMAGE" + + ' Visualizza Sezione ed Immagine solo se fa parte di DG_Statistics_PART Private m_vRawPartVisibility As Visibility Public ReadOnly Property vRawPartVisibility As Visibility Get @@ -264,7 +269,7 @@ Public Class ExpanderTable End Get End Property - 'Check Box per la visualizzazione nel PDF della sezione + ' Check Box per la visualizzazione nel PDF della sezione Private m_bSection_IsChecked As Boolean Public Property bSection_IsChecked As Boolean Get @@ -277,7 +282,7 @@ Public Class ExpanderTable End Set End Property - 'Check Box per la visualizzazione nel PDF dell' immagine + ' Check Box per la visualizzazione nel PDF dell' immagine Private m_bImage_IsChecked As Boolean Public Property bImage_IsChecked As Boolean Get @@ -290,6 +295,10 @@ Public Class ExpanderTable End Set End Property +#End Region ' Section & Image + +#End Region ' FIELDS & PROPERTIES + #Region "MESSAGES" Public ReadOnly Property Section_Msg As String @@ -306,8 +315,6 @@ Public Class ExpanderTable #End Region ' Messages -#End Region ' FIELDS & PROPERTIES - ' Definizione comandi Private m_cmdMoveUpOrder As ICommand Private m_cmdMoveDownOrder As ICommand @@ -321,7 +328,7 @@ Public Class ExpanderTable m_bImage_IsChecked = GetMainPrivateProfileInt(S_PDFEDITOR, S_IMAGE, 0) <> 0 End Sub -#End Region ' CONTRUCTORS +#End Region ' Constructors #Region "COMMANDS" @@ -371,7 +378,7 @@ Public Class ExpanderTable #End Region ' MoveDownOrder -#End Region ' COMMANDS +#End Region ' Commands End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb index 31df9311..fad567a7 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb @@ -153,6 +153,10 @@ Module PDFHelper Dim sTVolume As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTVOLUME) ' Recupero colonna 'colTotVolume' con relativo checkbox Dim sTTime As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTTIME) ' Recupero colonna 'colTotTime' con relativo checkbox Dim section As Section = document.LastSection() + DefineItem(document, nListType, bPreview, sMachGroupList, sName, sW, sH, sL, sMaterial, sUsage, sWaste, sUTime, sQty, sPDN, sDesc, sCNT, sAdded, sDone, sUVolume, sTVolume, sTTime, section) + End Sub + + Private Sub DefineItem(document As Document, nListType As ListTypes, bPreview As Boolean, sMachGroupList As ExpanderTable, sName As EgtDataGridColumn, sW As EgtDataGridColumn, sH As EgtDataGridColumn, sL As EgtDataGridColumn, sMaterial As EgtDataGridColumn, sUsage As EgtDataGridColumn, sWaste As EgtDataGridColumn, sUTime As EgtDataGridColumn, sQty As EgtDataGridColumn, sPDN As EgtDataGridColumn, sDesc As EgtDataGridColumn, sCNT As EgtDataGridColumn, sAdded As EgtDataGridColumn, sDone As EgtDataGridColumn, sUVolume As EgtDataGridColumn, sTVolume As EgtDataGridColumn, sTTime As EgtDataGridColumn, section As Section) Select Case nListType Case ListTypes.PART section.AddParagraph("Part List", "Heading2") diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb index 1ee67114..b4d7d5cc 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb @@ -324,8 +324,9 @@ Public Class StatisticsVM Dim document As Document = PDFHelper.CreateStatReport(ActivePage, bPreview) Dim documentPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\MigraDoc.mdddl" MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToFile(document, documentPath) - Dim renderer As New PdfDocumentRenderer(True) - renderer.Document = document + Dim renderer As New PdfDocumentRenderer(True) With { + .Document = document + } renderer.RenderDocument() ' salvo il documento Dim sFileName As String = "" From f140b6df541760077f179e24bfcfebca039d0ee4 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Fri, 29 Sep 2023 11:44:50 +0200 Subject: [PATCH 005/126] - correzione funzionamento OpenProject su BTL aggiunti direttamente a Prod --- .../OpenProjectFileDialogVM.vb | 4 +- .../OpenProjectFileDialogVM.vb | 5 +- .../OpenProjectFileDialogVM.vb | 51 ++++++++++--------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogVM.vb b/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogVM.vb index 73e2dc6b..bb3f303b 100644 --- a/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogVM.vb @@ -42,6 +42,8 @@ Public MustInherit Class OpenProjectFileDialogVM Friend Event m_CloseWindow(bDialogResult As Boolean) + Protected m_GoToProd As Boolean = False + Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn) Public Property ProjectColumns As ObservableCollection(Of EgtDataGridColumn) Get @@ -438,7 +440,7 @@ Public MustInherit Class OpenProjectFileDialogVM #Region "METHODS" Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean? - Public Overridable Sub RefreshProjectList(Optional GoToProd As Boolean = False) + Public Overridable Sub RefreshProjectList() End Sub Protected Sub LoadColumns(ProjectType As ProjectType) diff --git a/EgtBEAMWALL.Supervisor/OpenProjectFileDialog/OpenProjectFileDialogVM.vb b/EgtBEAMWALL.Supervisor/OpenProjectFileDialog/OpenProjectFileDialogVM.vb index 5a98738d..6a5ebb90 100644 --- a/EgtBEAMWALL.Supervisor/OpenProjectFileDialog/OpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.Supervisor/OpenProjectFileDialog/OpenProjectFileDialogVM.vb @@ -11,13 +11,14 @@ Public Class OpenProjectFileDialogVM Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean? m_ProjectType = ProjectType + m_GoToProd = GoToProd ' carico colonne LoadColumns(m_ProjectType) NotifyPropertyChanged(NameOf(FilterTypeList)) m_SelFilterType = m_FilterTypeList(0) ' carico lista progetti If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then - RefreshProjectList(GoToProd) + RefreshProjectList() Else m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList) NotifyPropertyChanged(NameOf(ProjectList)) @@ -26,7 +27,7 @@ Public Class OpenProjectFileDialogVM m_ProjectList_View.Filter = AddressOf ProjectFilter End Function - Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False) + Public Overrides Sub RefreshProjectList() m_ProjectList.Clear() ' calcolo periodo e righe Dim dtStart As DateTime diff --git a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb index fbb1481f..3a94b47e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb @@ -12,6 +12,7 @@ Public Class OpenProjectFileDialogVM Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean? m_ProjectType = ProjectType + m_GoToProd = GoToProd ' carico colonne LoadColumns(ProjectType) NotifyPropertyChanged(NameOf(FilterTypeList)) @@ -19,7 +20,7 @@ Public Class OpenProjectFileDialogVM ' carico lista progetti If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then SetFixedProjectList(False) - RefreshProjectList(GoToProd) + RefreshProjectList() Else SetFixedProjectList(True) m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList) @@ -29,7 +30,7 @@ Public Class OpenProjectFileDialogVM m_ProjectList_View.Filter = AddressOf ProjectFilter End Function - Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False) + Public Overrides Sub RefreshProjectList() m_ProjectList.Clear() ' calcolo periodo e righe Dim dtStart As DateTime @@ -66,30 +67,15 @@ Public Class OpenProjectFileDialogVM Else DbProjectList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity, False) End If - For Each Project In DbProjectList - ' recupero path per verificare esista - If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For - Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge" - If File.Exists(sPath) Then - m_ProjectList.Add(New ProjFileVM(Project)) - Else - ' CheckMe impostata come cancellazione FISICA dal DB... - DbControllers.m_ProjController.DeleteProj(Project.nProjId, False) - EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000")) - End If - Next - ElseIf m_ProjectType = ProjectType.PROD Then - Dim DbProjectList As New List(Of ProdFileM) - DbProjectList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True) - If GoToProd Then + If m_GoToProd Then For Each Project In DbProjectList ' recupero path per verificare esista If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For - Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge" + Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge" If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso Project.nType = Map.refProjManagerVM.CurrProj.nType Then If File.Exists(sPath) Then - m_ProjectList.Add(New ProdFileVM(Project)) + m_ProjectList.Add(New ProjFileVM(Project)) Else DbControllers.m_ProdController.DeleteProd(Project.nProdId, True) EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000")) @@ -99,16 +85,31 @@ Public Class OpenProjectFileDialogVM Else For Each Project In DbProjectList ' recupero path per verificare esista - If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For - Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge" + If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For + Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge" If File.Exists(sPath) Then - m_ProjectList.Add(New ProdFileVM(Project)) + m_ProjectList.Add(New ProjFileVM(Project)) Else - DbControllers.m_ProdController.DeleteProd(Project.nProdId, True) - EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000")) + ' CheckMe impostata come cancellazione FISICA dal DB... + DbControllers.m_ProjController.DeleteProj(Project.nProjId, False) + EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000")) End If Next End If + ElseIf m_ProjectType = ProjectType.PROD Then + Dim DbProjectList As New List(Of ProdFileM) + DbProjectList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True) + For Each Project In DbProjectList + ' recupero path per verificare esista + If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For + Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge" + If File.Exists(sPath) Then + m_ProjectList.Add(New ProdFileVM(Project)) + Else + DbControllers.m_ProdController.DeleteProd(Project.nProdId, True) + EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000")) + End If + Next End If End Sub From bc7381de639bb45e0db106291d008ee288c8ce06 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 29 Sep 2023 12:39:24 +0200 Subject: [PATCH 006/126] Modifica nomi tabella in PDF Editor --- EgtBEAMWALL.Core/Constants/ConstColumns.vb | 6 +- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 5 +- .../Statistics/PDFEditorV.xaml | 5 +- .../Statistics/PDFEditorVM.vb | 58 +++++++++++++++ .../Statistics/PDFHelper.vb | 73 ++++++++++--------- 5 files changed, 104 insertions(+), 43 deletions(-) diff --git a/EgtBEAMWALL.Core/Constants/ConstColumns.vb b/EgtBEAMWALL.Core/Constants/ConstColumns.vb index dd1e6519..d9d9758e 100644 --- a/EgtBEAMWALL.Core/Constants/ConstColumns.vb +++ b/EgtBEAMWALL.Core/Constants/ConstColumns.vb @@ -1,5 +1,6 @@ Public Module ConstColumns + Public Const COL_ID As String = "colID" Public Const COL_DO As String = "colDO" Public Const COL_VALUE As String = "colVALUE" Public Const COL_CUSTOM As String = "colCUSTOM" @@ -34,11 +35,6 @@ Public Const COL_SUPERVISORID As String = "colSUPERVISORID" Public Const COL_PRIORITY As String = "colPRIORITY" Public Const COL_QTY As String = "colQTY" - Public Const COL_NAME As String = "colNAME" - Public Const COL_H As String = "colH" - Public Const COL_MATERIAL As String = "colMATERIAL" - Public Const COL_USAGE As String = "colUSAGE" - Public Const COL_WASTE As String = "colWASTE" Public Const COL_ARCHIVED As String = "colARCHIVED" End Module diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index 2f3c33ca..0f96b795 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -1006,7 +1006,6 @@ -<<<<<<< HEAD @@ -1017,9 +1016,9 @@ -======= + + ->>>>>>> origin/master diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml index 8f964bbb..c5d3c895 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml @@ -3,6 +3,9 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"> + + + @@ -82,7 +85,7 @@ - diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb index c9edf18f..cfd46754 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb @@ -2,6 +2,7 @@ Imports EgtBEAMWALL.Core Imports EgtWPFLib5 Imports EgtUILib +Imports System.Globalization Public Class PDFEditorVM Inherits VMBase @@ -406,4 +407,61 @@ Public Class WebBrowserUtility browser.Source = If(uri IsNot Nothing, New Uri(uri), Nothing) End If End Sub +End Class + +Class ColumnNameConverter + Implements IValueConverter + + Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert + Dim ColName As String = "" + If TypeOf value Is String Then + ColName = CStr(value) + Select Case value + Case COL_PDN + Return Map.refStatisticsVM.PDN_Msg + Case COL_W + Return Map.refStatisticsVM.W_Msg + Case COL_H + Return Map.refStatisticsVM.H_Msg + Case COL_L + Return Map.refStatisticsVM.L_Msg + Case COL_DESC + Return Map.refStatisticsVM.NAM_Msg + Case COL_NAME + Return Map.refStatisticsVM.NAM_Msg + Case COL_MATERIAL + Return Map.refStatisticsVM.MAT_Msg + Case COL_CNT + Return Map.refStatisticsVM.CNT_Msg + Case COL_ADDED + Return Map.refStatisticsVM.ADDED_Msg + Case COL_DONE + Return Map.refStatisticsVM.DONE_Msg + Case COL_USAGE + Return Map.refStatisticsVM.Used_Msg + Case COL_WASTE + Return Map.refStatisticsVM.Waste_Msg + Case COL_UNITVOLUME + Return Map.refStatisticsVM.UNIT_VOLUME_Msg + Case COL_TOTVOLUME + Return Map.refStatisticsVM.TOT_VOLUME_Msg + Case COL_UNITTIME + Return Map.refStatisticsVM.UNIT_TIME_Msg + Case COL_TOTTIME + Return Map.refStatisticsVM.TOT_TIME_Msg + Case COL_QTY + Return Map.refStatisticsVM.QTY_Msg + Case COL_INPROD + Return Map.refStatisticsVM.INPROD_Msg + Case Else + Return Nothing + End Select + Else + Return Nothing + End If + End Function + + Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack + Throw New NotImplementedException() + End Function End Class \ No newline at end of file diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb index fad567a7..0c5ef5dd 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb @@ -152,11 +152,12 @@ Module PDFHelper Dim sUVolume As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_UNITVOLUME) ' Recupero colonna 'colUnitVolume' con relativo checkbox Dim sTVolume As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTVOLUME) ' Recupero colonna 'colTotVolume' con relativo checkbox Dim sTTime As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_TOTTIME) ' Recupero colonna 'colTotTime' con relativo checkbox + Dim sINProd As EgtDataGridColumn = sMachGroupList.RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_INPROD) ' Recupero colonna 'colInProd' con relativo checkbox Dim section As Section = document.LastSection() - DefineItem(document, nListType, bPreview, sMachGroupList, sName, sW, sH, sL, sMaterial, sUsage, sWaste, sUTime, sQty, sPDN, sDesc, sCNT, sAdded, sDone, sUVolume, sTVolume, sTTime, section) + DefineItem(document, nListType, bPreview, sMachGroupList, sName, sW, sH, sL, sMaterial, sUsage, sWaste, sUTime, sQty, sPDN, sDesc, sCNT, sAdded, sDone, sUVolume, sTVolume, sTTime, sINProd, section) End Sub - Private Sub DefineItem(document As Document, nListType As ListTypes, bPreview As Boolean, sMachGroupList As ExpanderTable, sName As EgtDataGridColumn, sW As EgtDataGridColumn, sH As EgtDataGridColumn, sL As EgtDataGridColumn, sMaterial As EgtDataGridColumn, sUsage As EgtDataGridColumn, sWaste As EgtDataGridColumn, sUTime As EgtDataGridColumn, sQty As EgtDataGridColumn, sPDN As EgtDataGridColumn, sDesc As EgtDataGridColumn, sCNT As EgtDataGridColumn, sAdded As EgtDataGridColumn, sDone As EgtDataGridColumn, sUVolume As EgtDataGridColumn, sTVolume As EgtDataGridColumn, sTTime As EgtDataGridColumn, section As Section) + Private Sub DefineItem(document As Document, nListType As ListTypes, bPreview As Boolean, sMachGroupList As ExpanderTable, sName As EgtDataGridColumn, sW As EgtDataGridColumn, sH As EgtDataGridColumn, sL As EgtDataGridColumn, sMaterial As EgtDataGridColumn, sUsage As EgtDataGridColumn, sWaste As EgtDataGridColumn, sUTime As EgtDataGridColumn, sQty As EgtDataGridColumn, sPDN As EgtDataGridColumn, sDesc As EgtDataGridColumn, sCNT As EgtDataGridColumn, sAdded As EgtDataGridColumn, sDone As EgtDataGridColumn, sUVolume As EgtDataGridColumn, sTVolume As EgtDataGridColumn, sTTime As EgtDataGridColumn, sINProd As EgtDataGridColumn, section As Section) Select Case nListType Case ListTypes.PART section.AddParagraph("Part List", "Heading2") @@ -229,7 +230,7 @@ Module PDFHelper End Select For ColumnIndex = 0 To Columnlist.Count - 1 Select Case Columnlist(ColumnIndex).Name - Case "colPDN" + Case COL_PDN If sPDN.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(1.5)) @@ -241,7 +242,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colID" + Case COL_ID If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(1.5)) ElseIf PartIndex = -1 Then @@ -249,7 +250,7 @@ Module PDFHelper ElseIf nListType = ListTypes.MACHGROUP Then row.Cells(ColumnIndex).AddParagraph(MachGroupVM.Id) End If - Case "colW" + Case COL_W 'If PartIndex = -2 Then ' table.AddColumn(Unit.FromCentimeter(2)) 'ElseIf PartIndex = -1 Then @@ -289,7 +290,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colH" + Case COL_H 'If PartIndex = -2 Then ' table.AddColumn(Unit.FromCentimeter(2)) 'ElseIf PartIndex = -1 Then @@ -329,7 +330,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colL" + Case COL_L 'If PartIndex = -2 Then ' table.AddColumn(Unit.FromCentimeter(2)) 'ElseIf PartIndex = -1 Then @@ -369,7 +370,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colDESC" + Case COL_DESC 'If PartIndex = -2 Then ' table.AddColumn(Unit.FromCentimeter(4)) 'ElseIf PartIndex = -1 Then @@ -399,7 +400,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colNAME" + Case COL_NAME 'If PartIndex = -2 Then ' table.AddColumn(Unit.FromCentimeter(4)) 'ElseIf PartIndex = -1 Then @@ -429,7 +430,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colMATERIAL" + Case COL_MATERIAL 'If PartIndex = -2 Then ' table.AddColumn(Unit.FromCentimeter(2)) 'ElseIf PartIndex = -1 Then @@ -469,7 +470,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colCNT" + Case COL_CNT If sCNT.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(1)) @@ -481,7 +482,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colADDED" + Case COL_ADDED If sAdded.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(1)) @@ -493,15 +494,19 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colINPROD" - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.INPROD_Msg) - ElseIf nListType = ListTypes.PART Then - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nINPROD) + Case COL_INPROD + If sINProd.bIsChecked Then + If PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(1)) + ElseIf PartIndex = -1 Then + row.Cells(ColumnIndex).AddParagraph(Map.refStatisticsVM.INPROD_Msg) + ElseIf nListType = ListTypes.PART Then + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nINPROD) + End If + ElseIf PartIndex = -2 Then + table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colDONE" + Case COL_DONE If sDone.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(1)) @@ -513,7 +518,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colUSAGE" + Case COL_USAGE If sUsage.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) @@ -525,7 +530,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colWASTE" + Case COL_WASTE If sWaste.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) @@ -537,7 +542,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colUNITVOLUME" + Case COL_UNITVOLUME 'If PartIndex = -2 Then ' table.AddColumn(Unit.FromCentimeter(2)) 'ElseIf PartIndex = -1 Then @@ -567,7 +572,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colTOTVOLUME" + Case COL_TOTVOLUME If sTVolume.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) @@ -579,7 +584,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colUNITTIME" + Case COL_UNITTIME 'If PartIndex = -2 Then ' table.AddColumn(Unit.FromCentimeter(2)) 'ElseIf PartIndex = -1 Then @@ -609,7 +614,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colTOTTIME" + Case COL_TOTTIME If sTTime.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) @@ -621,7 +626,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colQTY" + Case COL_QTY If sQty.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) @@ -711,7 +716,7 @@ Module PDFHelper Columnlist = sMachGroupList.RawPartColumns For ColumnIndex = 0 To Columnlist.Count - 1 Select Case Columnlist(ColumnIndex).Name - Case "colPDN" + Case COL_PDN If sPDN.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(1.5)) @@ -723,7 +728,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colW" + Case COL_W If sW.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) @@ -735,7 +740,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colH" + Case COL_H If sH.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) @@ -747,7 +752,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colL" + Case COL_L If sL.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) @@ -759,7 +764,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colDESC" + Case COL_DESC If sDesc.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(4)) @@ -771,7 +776,7 @@ Module PDFHelper ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) End If - Case "colNAME" + Case COL_NAME If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(4)) ElseIf PartIndex = -1 Then @@ -779,7 +784,7 @@ Module PDFHelper Else row.Cells(ColumnIndex).AddParagraph(PartVM.sNAM) End If - Case "colMATERIAL" + Case COL_MATERIAL If sMaterial.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) From f65d07ab22dd8de93f00b8661c6ce32ba68324d0 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Fri, 29 Sep 2023 15:53:47 +0200 Subject: [PATCH 007/126] - aggiunta lista ProjFileM in ProdFileM --- EgtBEAMWALL.Core/ProjectFileVM/ProdFileM.vb | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/EgtBEAMWALL.Core/ProjectFileVM/ProdFileM.vb b/EgtBEAMWALL.Core/ProjectFileVM/ProdFileM.vb index 58286ce9..df781938 100644 --- a/EgtBEAMWALL.Core/ProjectFileVM/ProdFileM.vb +++ b/EgtBEAMWALL.Core/ProjectFileVM/ProdFileM.vb @@ -14,6 +14,13 @@ Public Class ProdFileM m_nProjIdList = value End Sub + Protected m_ProjMList As List(Of ProjFileM) + Public ReadOnly Property ProjMList As List(Of ProjFileM) + Get + Return m_ProjMList + End Get + End Property + Protected m_sName As String Public Property sName As String Get @@ -60,6 +67,24 @@ Public Class ProdFileM Return NewProjectFileM End Function + Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType, + sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdFileM + Dim NewProjectFileM As New ProdFileM + NewProjectFileM.m_nProdId = nProdId + NewProjectFileM.m_nProjIdList = nProjIdList + NewProjectFileM.m_dtCreateDate = dtCreateProjDate + NewProjectFileM.m_sName = sName + NewProjectFileM.m_nType = nType + NewProjectFileM.m_sMachine = sMachine + NewProjectFileM.m_sLockedBy = sLockedBy + NewProjectFileM.m_dtLock = dtLock + NewProjectFileM.m_bIsActive = bIsActive + NewProjectFileM.m_bIsProduced = bIsProduced + NewProjectFileM.m_bIsArchived = bIsArchived + NewProjectFileM.m_ProjMList = ProjMList + Return NewProjectFileM + End Function + #End Region ' CONSTRUCTORS End Class \ No newline at end of file From fb92f9faea5d7f07d8c572ffe31f975477b8ee00 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 29 Sep 2023 15:56:26 +0200 Subject: [PATCH 008/126] typo --- EgtBEAMWALL.DataLayer/Controllers/ProjController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EgtBEAMWALL.DataLayer/Controllers/ProjController.cs b/EgtBEAMWALL.DataLayer/Controllers/ProjController.cs index b546fea7..870f64a4 100644 --- a/EgtBEAMWALL.DataLayer/Controllers/ProjController.cs +++ b/EgtBEAMWALL.DataLayer/Controllers/ProjController.cs @@ -33,6 +33,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers var dbResult = localDbCtx .ProjList .Where(x => x.BTLFileName == BTLFileName) + //valutare se usare solo attivi... + //.Where(x => x.BTLFileName == BTLFileName && x.IsActive == true) .FirstOrDefault(); //se avesse trovato-- > riporto id... @@ -581,7 +583,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers /// Update record su DB x elenco BTLParts /// /// - /// + /// /// public ProjModel UpdateBtlParts(int ProjId, List BtlPartList) { From 689e81219bdab6876fe5752a16435b02c88ed5c3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 29 Sep 2023 16:37:25 +0200 Subject: [PATCH 009/126] Modifica x gestione lettura proj insieme a prod (da testare) --- .../Controllers/ProdController.cs | 88 ++++++++++++++++++- .../DatabaseModels/ProdModel.cs | 10 +++ 2 files changed, 97 insertions(+), 1 deletion(-) diff --git a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs index 509259d7..ce33d92a 100644 --- a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs +++ b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs @@ -2,6 +2,7 @@ using NLog; using System; using System.Collections.Generic; +using System.Data.Entity; using System.Linq; using static EgtBEAMWALL.Core.ConstBeam; @@ -285,6 +286,90 @@ namespace EgtBEAMWALL.DataLayer.Controllers return result; } + /// + /// Elenco prod + /// + /// Num max record da recuperare + /// Solo con ALMENO 1 PROJ attivo (senza cancellazione logica) + /// Se true: mostra anche archiviati (default li nasconde) + /// + public List GetLastDescFull(int numRecord, bool OnlyActive, bool ShowArchived = false) + { + List result = new List(); + //List dbResult = GetLastDbModelDesc(numRecord); + List dbResult = new List(); + using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) + { + // se numRecord = 0 --> passo tutti + if (numRecord == 0) + { + numRecord = localDbCtx.ProdList.Count(); + } + // retrieve + dbResult = localDbCtx + .ProdList + .Where(x => (!x.IsArchived || ShowArchived)) + //.Include(j => j.) + // condizione join sui PROJ + .Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive), + p => p.ProdDbId, + e => e.ProdDbId, + (p, e) => p) + .Distinct() + .Include(j => j.ProjListNav) + .OrderByDescending(x => x.ProdId) + .Take(numRecord) + .ToList(); + } + + // conversione + result = dbResult.Select(x => coreConv(x)).ToList(); + //result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived, x.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, x.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList())).ToList(); + return result; + } + /// + /// Elenco prod + /// + /// Inizio periodo estrazione + /// Fine periodo estrazione + /// Num max record da recuperare + /// Solo con ALMENO 1 PROJ attivo (senza cancellazione logica) + /// Se true: mostra anche archiviati (default li nasconde) + /// + public List GetLastDescFull(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive, bool ShowArchived = false) + { + List result = new List(); + //List dbResult = GetLastDbModelDesc(numRecord); + List dbResult = new List(); + using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) + { + // se numRecord = 0 --> passo tutti + if (numRecord == 0) + { + numRecord = localDbCtx.ProdList.Count(); + } + // retrieve + dbResult = localDbCtx + .ProdList + .Where(x => x.DtCreated >= dtStart && x.DtCreated <= dtEnd && (!x.IsArchived || ShowArchived)) + // condizione join sui PROJ + .Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive), + p => p.ProdDbId, + e => e.ProdDbId, + (p, e) => p) + .Distinct() + .Include(j => j.ProjListNav) + .OrderByDescending(x => x.ProdId) + .Take(numRecord) + .ToList(); + } + + // conversione + result = dbResult.Select(x => coreConv(x)).ToList(); + //result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived, x.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, x.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList())).ToList(); + return result; + } + /// /// Fornisce nuovo indice VUOTO da usare (allocando sul DB) /// @@ -909,7 +994,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers /// protected Core.ProdFileM coreConv(ProdModel currProd) { - Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived); + //Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived); + Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList()); return answ; } diff --git a/EgtBEAMWALL.DataLayer/DatabaseModels/ProdModel.cs b/EgtBEAMWALL.DataLayer/DatabaseModels/ProdModel.cs index 093201f2..7999da61 100644 --- a/EgtBEAMWALL.DataLayer/DatabaseModels/ProdModel.cs +++ b/EgtBEAMWALL.DataLayer/DatabaseModels/ProdModel.cs @@ -19,6 +19,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels { #region Public Properties + public ProdModel() + { + ProjListNav = new HashSet(); + } + /// /// Chiave univoca DB /// @@ -98,6 +103,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels [Column("IsArchived")] public bool IsArchived { get; set; } = false; + /// + /// Collezione oggetti Proj associati (almeno 1 by design) + /// + public virtual ICollection ProjListNav { get; set; } + #endregion Public Properties } } \ No newline at end of file From 946ad1d29c20402d88229245b78655a4d4036eb3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 29 Sep 2023 17:13:53 +0200 Subject: [PATCH 010/126] Modifica output: Prod --> prodItem list --- EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj | 1 + .../NewOpenProjectFileDialogVM.vb | 91 --------------- EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb | 109 ++++++++++++++++++ .../Controllers/ProdController.cs | 27 +++-- 4 files changed, 129 insertions(+), 99 deletions(-) create mode 100644 EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb diff --git a/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj b/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj index 69217ff5..bb1e5b00 100644 --- a/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj +++ b/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj @@ -116,6 +116,7 @@ NewOpenProjectFileDialogV.xaml + diff --git a/EgtBEAMWALL.Core/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb b/EgtBEAMWALL.Core/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb index 10507a51..8246ab49 100644 --- a/EgtBEAMWALL.Core/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.Core/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb @@ -779,94 +779,3 @@ Public MustInherit Class NewOpenProjectFileDialogVM End Class -Public Class ProdItem - Inherits VMBase - - Public Shared m_delIsModifiedSetUp As Action(Of Boolean) - - Protected m_ProdFileVM As ProdFileVM - Public ReadOnly Property ProdFileVM As ProdFileVM - Get - Return m_ProdFileVM - End Get - End Property - - Private m_ProjFileList As New List(Of ProjectFileVM) - Public ReadOnly Property ProjFileList As List(Of ProjectFileVM) - Get - Return m_ProjFileList - End Get - End Property - - Public ReadOnly Property sProdId As String - Get - Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sProdId, "") - End Get - End Property - - Public Overridable Property sName As String - Get - Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "") - End Get - Set(value As String) - If Not IsNothing(m_ProdFileVM) Then - m_ProdFileVM.sName = value - End If - End Set - End Property - - Public ReadOnly Property dtCreateDate As Date - Get - Return If(Not IsNothing(m_ProdFileVM), {m_ProdFileVM.dtCreateDate, m_ProjFileList.Min(Function(x) x.dtCreateDate)}.Min(), m_ProjFileList.Min(Function(x) x.dtCreateDate)) - End Get - End Property - Public ReadOnly Property sCreateDate As String - Get - Return dtCreateDate.ToString() - End Get - End Property - - Public ReadOnly Property sMachine As String - Get - If Not IsNothing(m_ProdFileVM) Then - Return m_ProdFileVM.sMachine - ElseIf Not IsNothing(m_ProjFileList(0)) Then - Return m_ProjFileList(0).sMachine - Else Return "" - End If - End Get - End Property - - Public ReadOnly Property bIsArchived As Boolean - Get - If Not IsNothing(m_ProdFileVM) Then - Return m_ProdFileVM.bIsArchived - ElseIf Not IsNothing(m_ProjFileList(0)) Then - Return m_ProjFileList(0).bIsArchived - Else - Return True - End If - End Get - End Property - - Public ReadOnly Property Archived_Visibility As Visibility - Get - Return If(bIsArchived, Visibility.Visible, Visibility.Collapsed) - End Get - End Property - - Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM) - m_ProdFileVM = ProdFileVM - m_ProjFileList.Add(ProjFileVM) - End Sub - - Sub New(ProjFileVM As ProjFileVM) - m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM}) - End Sub - - Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM)) - m_ProdFileVM = ProdFileVM - m_ProjFileList = ProjFileVMList - End Sub - -End Class diff --git a/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb b/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb new file mode 100644 index 00000000..c00abb2b --- /dev/null +++ b/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb @@ -0,0 +1,109 @@ + +Imports EgtWPFLib5 +Imports System.Windows + +Public Class ProdItem + Inherits VMBase + + Public Shared m_delIsModifiedSetUp As Action(Of Boolean) + + Protected m_ProdFileVM As ProdFileVM + Public ReadOnly Property ProdFileVM As ProdFileVM + Get + Return m_ProdFileVM + End Get + End Property + + Private m_ProjFileList As New List(Of ProjectFileVM) + Public ReadOnly Property ProjFileList As List(Of ProjectFileVM) + Get + Return m_ProjFileList + End Get + End Property + + Public ReadOnly Property sProdId As String + Get + Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sProdId, "") + End Get + End Property + + Public Overridable Property sName As String + Get + Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "") + End Get + Set(value As String) + If Not IsNothing(m_ProdFileVM) Then + m_ProdFileVM.sName = value + End If + End Set + End Property + + Public ReadOnly Property dtCreateDate As Date + Get + Return If(Not IsNothing(m_ProdFileVM), {m_ProdFileVM.dtCreateDate, m_ProjFileList.Min(Function(x) x.dtCreateDate)}.Min(), m_ProjFileList.Min(Function(x) x.dtCreateDate)) + End Get + End Property + Public ReadOnly Property sCreateDate As String + Get + Return dtCreateDate.ToString() + End Get + End Property + + Public ReadOnly Property sMachine As String + Get + If Not IsNothing(m_ProdFileVM) Then + Return m_ProdFileVM.sMachine + ElseIf Not IsNothing(m_ProjFileList(0)) Then + Return m_ProjFileList(0).sMachine + Else Return "" + End If + End Get + End Property + + Public ReadOnly Property bIsArchived As Boolean + Get + If Not IsNothing(m_ProdFileVM) Then + Return m_ProdFileVM.bIsArchived + ElseIf Not IsNothing(m_ProjFileList(0)) Then + Return m_ProjFileList(0).bIsArchived + Else + Return True + End If + End Get + End Property + + Public ReadOnly Property Archived_Visibility As Visibility + Get + Return If(bIsArchived, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + + Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM) + m_ProdFileVM = ProdFileVM + m_ProjFileList.Add(ProjFileVM) + End Sub + + Sub New(ProjFileVM As ProjFileVM) + m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM}) + End Sub + + Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM)) + m_ProdFileVM = ProdFileVM + m_ProjFileList = ProjFileVMList + End Sub + + + Public Shared Function CreateProdItem(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType, + sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdItem + + + Dim NewProdFileM = ProdFileM.CreateProdFileM(nProdId, nProjIdList, dtCreateProjDate, sName, nType, sMachine, sLockedBy, dtLock, bIsActive, bIsProduced, bIsArchived) + Dim NewProdFileVM = New ProdFileVM(NewProdFileM) + Dim NewProjFileVM As IEnumerable(Of ProjectFileVM) + NewProjFileVM = ProjMList.Select(Of ProjFileVM)(Function(j) New ProjFileVM(j)).ToList + Dim NewProdItem = New ProdItem(NewProdFileVM, NewProjFileVM.ToList) + + Return NewProdItem + End Function + +End Class \ No newline at end of file diff --git a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs index ce33d92a..ac1537bf 100644 --- a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs +++ b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs @@ -293,9 +293,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers /// Solo con ALMENO 1 PROJ attivo (senza cancellazione logica) /// Se true: mostra anche archiviati (default li nasconde) /// - public List GetLastDescFull(int numRecord, bool OnlyActive, bool ShowArchived = false) + public List GetLastDescFull(int numRecord, bool OnlyActive, bool ShowArchived = false) { - List result = new List(); + List result = new List(); //List dbResult = GetLastDbModelDesc(numRecord); List dbResult = new List(); using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) @@ -323,7 +323,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers } // conversione - result = dbResult.Select(x => coreConv(x)).ToList(); + result = dbResult.Select(x => coreItemConv(x)).ToList(); //result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived, x.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, x.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList())).ToList(); return result; } @@ -336,9 +336,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers /// Solo con ALMENO 1 PROJ attivo (senza cancellazione logica) /// Se true: mostra anche archiviati (default li nasconde) /// - public List GetLastDescFull(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive, bool ShowArchived = false) + public List GetLastDescFull(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive, bool ShowArchived = false) { - List result = new List(); + List result = new List(); //List dbResult = GetLastDbModelDesc(numRecord); List dbResult = new List(); using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) @@ -365,7 +365,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers } // conversione - result = dbResult.Select(x => coreConv(x)).ToList(); + result = dbResult.Select(x => coreItemConv(x)).ToList(); //result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived, x.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, x.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList())).ToList(); return result; } @@ -994,8 +994,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers /// protected Core.ProdFileM coreConv(ProdModel currProd) { - //Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived); - Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList()); + Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived); + //Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList()); + return answ; + } + + /// + /// Helper conversione modelli verso prodItem + /// + /// + /// + protected Core.ProdItem coreItemConv(ProdModel currProd) + { + Core.ProdItem answ = Core.ProdItem.CreateProdItem(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList()); return answ; } From efea14db897519846166322c0f23ea6f5a471aaa Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Fri, 29 Sep 2023 17:33:29 +0200 Subject: [PATCH 011/126] - aggiunto metodo per creare ProItem con solo ProjFileM --- EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb b/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb index c00abb2b..5bb31bb0 100644 --- a/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb +++ b/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb @@ -93,17 +93,24 @@ Public Class ProdItem End Sub - Public Shared Function CreateProdItem(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType, + Public Shared Function CreateProdItem(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType, sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdItem - Dim NewProdFileM = ProdFileM.CreateProdFileM(nProdId, nProjIdList, dtCreateProjDate, sName, nType, sMachine, sLockedBy, dtLock, bIsActive, bIsProduced, bIsArchived) - Dim NewProdFileVM = New ProdFileVM(NewProdFileM) - Dim NewProjFileVM As IEnumerable(Of ProjectFileVM) - NewProjFileVM = ProjMList.Select(Of ProjFileVM)(Function(j) New ProjFileVM(j)).ToList - Dim NewProdItem = New ProdItem(NewProdFileVM, NewProjFileVM.ToList) + Dim NewProdFileM = ProdFileM.CreateProdFileM(nProdId, nProjIdList, dtCreateProjDate, sName, nType, sMachine, sLockedBy, dtLock, bIsActive, bIsProduced, bIsArchived) + Dim NewProdFileVM = New ProdFileVM(NewProdFileM) + Dim NewProjFileVM As IEnumerable(Of ProjectFileVM) + NewProjFileVM = ProjMList.Select(Of ProjFileVM)(Function(j) New ProjFileVM(j)).ToList + Dim NewProdItem = New ProdItem(NewProdFileVM, NewProjFileVM.ToList) - Return NewProdItem - End Function + Return NewProdItem + End Function + + Public Shared Function CreateProdItem(ProjFileM As ProjFileM) As ProdItem + + Dim NewProdItem = New ProdItem(New ProjFileVM(ProjFileM)) + + Return NewProdItem + End Function End Class \ No newline at end of file From ec2ce96b3bfda1ccc97918f05981564a41ad9def Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 29 Sep 2023 17:48:11 +0200 Subject: [PATCH 012/126] Aggiunta in coda dei proj "orfani" --- .../Controllers/ProdController.cs | 55 +++++++++++++++---- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs index ac1537bf..796127d1 100644 --- a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs +++ b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs @@ -296,8 +296,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers public List GetLastDescFull(int numRecord, bool OnlyActive, bool ShowArchived = false) { List result = new List(); - //List dbResult = GetLastDbModelDesc(numRecord); - List dbResult = new List(); + // elenco prod completi + List dbResultProd = new List(); + // elenco proj "orfani" + List dbResultProj = new List(); using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) { // se numRecord = 0 --> passo tutti @@ -305,8 +307,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers { numRecord = localDbCtx.ProdList.Count(); } - // retrieve - dbResult = localDbCtx + // recupero PROD + proj relativi + dbResultProd = localDbCtx .ProdList .Where(x => (!x.IsArchived || ShowArchived)) //.Include(j => j.) @@ -320,11 +322,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers .OrderByDescending(x => x.ProdId) .Take(numRecord) .ToList(); + + // recupero i proj "orfani" + dbResultProj = localDbCtx + .ProjList + .Where(x => (x.IsActive || !OnlyActive) && x.Prod == null) + .OrderByDescending(x => x.ProjId) + .Take(numRecord) + .ToList(); } // conversione - result = dbResult.Select(x => coreItemConv(x)).ToList(); - //result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived, x.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, x.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList())).ToList(); + result = dbResultProd.Select(x => coreItemConv(x)).ToList(); + var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList(); + // sommo i risultati + result.AddRange(resProj); return result; } /// @@ -340,7 +352,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers { List result = new List(); //List dbResult = GetLastDbModelDesc(numRecord); - List dbResult = new List(); + List dbResultProd = new List(); + // elenco proj "orfani" + List dbResultProj = new List(); using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) { // se numRecord = 0 --> passo tutti @@ -349,7 +363,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers numRecord = localDbCtx.ProdList.Count(); } // retrieve - dbResult = localDbCtx + dbResultProd = localDbCtx .ProdList .Where(x => x.DtCreated >= dtStart && x.DtCreated <= dtEnd && (!x.IsArchived || ShowArchived)) // condizione join sui PROJ @@ -362,11 +376,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers .OrderByDescending(x => x.ProdId) .Take(numRecord) .ToList(); + + // recupero i proj "orfani" + dbResultProj = localDbCtx + .ProjList + .Where(x => (x.IsActive || !OnlyActive) && x.Prod == null && (x.DtCreated >= dtStart && x.DtCreated <= dtEnd)) + .OrderByDescending(x => x.ProjId) + .Take(numRecord) + .ToList(); } // conversione - result = dbResult.Select(x => coreItemConv(x)).ToList(); - //result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived, x.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, x.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList())).ToList(); + result = dbResultProd.Select(x => coreItemConv(x)).ToList(); + var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList(); + // sommo i risultati + result.AddRange(resProj); return result; } @@ -1010,6 +1034,17 @@ namespace EgtBEAMWALL.DataLayer.Controllers return answ; } + /// + /// Helper conversione modelli verso prodItem da singolo proj + /// + /// + /// + protected Core.ProdItem coreItemConv(ProjModel currProj) + { + Core.ProdItem answ = Core.ProdItem.CreateProdItem(Core.ProjFileM.CreateProjFileM(currProj.ProjId, 0, currProj.DtCreated, currProj.DtExported, currProj.ListName, currProj.BTLFileName, currProj.ProjDescription, currProj.IsNew, currProj.Locked, currProj.PType, currProj.Machine, currProj.IsActive, currProj.IsActive)); + return answ; + } + protected List ProjIdByProd(int ProdId) { var ProjCtr = new ProjController(); From a83752e565a7d4609ffbf8ca42eec2aad009c136 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 30 Sep 2023 10:36:50 +0200 Subject: [PATCH 013/126] Aggiunta ulteriore metodo con filtro completo x - BtlName - ListName - Machine - tipo data --- .../Controllers/ProdController.cs | 129 ++++++++++++++---- 1 file changed, 99 insertions(+), 30 deletions(-) diff --git a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs index 796127d1..f7861d52 100644 --- a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs +++ b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs @@ -209,11 +209,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers /// /// Elenco prod /// - /// Num max record da recuperare + /// Num max record da recuperare /// Solo con ALMENO 1 PROJ attivo (senza cancellazione logica) /// Se true: mostra anche archiviati (default li nasconde) /// - public List GetLastDesc(int numRecord, bool OnlyActive, bool ShowArchived = false) + public List GetLastDesc(int NumRecord, bool OnlyActive, bool ShowArchived = false) { List result = new List(); //List dbResult = GetLastDbModelDesc(numRecord); @@ -221,9 +221,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) { // se numRecord = 0 --> passo tutti - if (numRecord == 0) + if (NumRecord == 0) { - numRecord = localDbCtx.ProdList.Count(); + NumRecord = localDbCtx.ProdList.Count(); } // retrieve dbResult = localDbCtx @@ -236,7 +236,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers (p, e) => p) .Distinct() .OrderByDescending(x => x.ProdId) - .Take(numRecord) + .Take(NumRecord) .ToList(); } @@ -248,13 +248,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers /// /// Elenco prod /// - /// Inizio periodo estrazione - /// Fine periodo estrazione - /// Num max record da recuperare + /// Inizio periodo estrazione + /// Fine periodo estrazione + /// Num max record da recuperare /// Solo con ALMENO 1 PROJ attivo (senza cancellazione logica) /// Se true: mostra anche archiviati (default li nasconde) /// - public List GetLastDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive, bool ShowArchived = false) + public List GetLastDesc(DateTime DtStart, DateTime DtEnd, int NumRecord, bool OnlyActive, bool ShowArchived = false) { List result = new List(); //List dbResult = GetLastDbModelDesc(numRecord); @@ -262,14 +262,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) { // se numRecord = 0 --> passo tutti - if (numRecord == 0) + if (NumRecord == 0) { - numRecord = localDbCtx.ProdList.Count(); + NumRecord = localDbCtx.ProdList.Count(); } // retrieve dbResult = localDbCtx .ProdList - .Where(x => x.DtCreated >= dtStart && x.DtCreated <= dtEnd && (!x.IsArchived || ShowArchived)) + .Where(x => x.DtCreated >= DtStart && x.DtCreated <= DtEnd && (!x.IsArchived || ShowArchived)) // condizione join sui PROJ .Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive), p => p.ProdDbId, @@ -277,7 +277,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers (p, e) => p) .Distinct() .OrderByDescending(x => x.ProdId) - .Take(numRecord) + .Take(NumRecord) .ToList(); } @@ -289,11 +289,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers /// /// Elenco prod /// - /// Num max record da recuperare + /// Num max record da recuperare /// Solo con ALMENO 1 PROJ attivo (senza cancellazione logica) /// Se true: mostra anche archiviati (default li nasconde) /// - public List GetLastDescFull(int numRecord, bool OnlyActive, bool ShowArchived = false) + public List GetLastDescFull(int NumRecord, bool OnlyActive, bool ShowArchived = false) { List result = new List(); // elenco prod completi @@ -303,9 +303,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) { // se numRecord = 0 --> passo tutti - if (numRecord == 0) + if (NumRecord == 0) { - numRecord = localDbCtx.ProdList.Count(); + NumRecord = localDbCtx.ProdList.Count(); } // recupero PROD + proj relativi dbResultProd = localDbCtx @@ -320,7 +320,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers .Distinct() .Include(j => j.ProjListNav) .OrderByDescending(x => x.ProdId) - .Take(numRecord) + .Take(NumRecord) .ToList(); // recupero i proj "orfani" @@ -328,7 +328,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers .ProjList .Where(x => (x.IsActive || !OnlyActive) && x.Prod == null) .OrderByDescending(x => x.ProjId) - .Take(numRecord) + .Take(NumRecord) .ToList(); } @@ -339,33 +339,34 @@ namespace EgtBEAMWALL.DataLayer.Controllers result.AddRange(resProj); return result; } + /// /// Elenco prod /// - /// Inizio periodo estrazione - /// Fine periodo estrazione - /// Num max record da recuperare + /// Inizio periodo estrazione + /// Fine periodo estrazione + /// Num max record da recuperare /// Solo con ALMENO 1 PROJ attivo (senza cancellazione logica) /// Se true: mostra anche archiviati (default li nasconde) /// - public List GetLastDescFull(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive, bool ShowArchived = false) + public List GetLastDescFull(DateTime DtStart, DateTime DtEnd, int NumRecord, bool OnlyActive, bool ShowArchived = false) { List result = new List(); - //List dbResult = GetLastDbModelDesc(numRecord); + // elenco prod completi List dbResultProd = new List(); // elenco proj "orfani" List dbResultProj = new List(); using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) { // se numRecord = 0 --> passo tutti - if (numRecord == 0) + if (NumRecord == 0) { - numRecord = localDbCtx.ProdList.Count(); + NumRecord = localDbCtx.ProdList.Count(); } // retrieve dbResultProd = localDbCtx .ProdList - .Where(x => x.DtCreated >= dtStart && x.DtCreated <= dtEnd && (!x.IsArchived || ShowArchived)) + .Where(x => x.DtCreated >= DtStart && x.DtCreated <= DtEnd && (!x.IsArchived || ShowArchived)) // condizione join sui PROJ .Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive), p => p.ProdDbId, @@ -374,18 +375,86 @@ namespace EgtBEAMWALL.DataLayer.Controllers .Distinct() .Include(j => j.ProjListNav) .OrderByDescending(x => x.ProdId) - .Take(numRecord) + .Take(NumRecord) .ToList(); // recupero i proj "orfani" dbResultProj = localDbCtx .ProjList - .Where(x => (x.IsActive || !OnlyActive) && x.Prod == null && (x.DtCreated >= dtStart && x.DtCreated <= dtEnd)) + .Where(x => (x.IsActive || !OnlyActive) && x.Prod == null && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) .OrderByDescending(x => x.ProjId) - .Take(numRecord) + .Take(NumRecord) .ToList(); } + // conversione + result = dbResultProd.Select(x => coreItemConv(x)).ToList(); + var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList(); + // sommo i risultati + result.AddRange(resProj); + return result; + } + /// + /// Elenco prod + /// + /// Inizio periodo estrazione + /// Fine periodo estrazione + /// Ture: usa data creazione / False: usa data export + /// Num max record da recuperare + /// Solo con ALMENO 1 PROJ attivo (senza cancellazione logica) + /// Nome Macchina (default vuoto = non usato) + /// Nome file BTL (default vuoto = non usato) + /// Nome List (default vuoto = non usato) + /// Se true: mostra anche archiviati (default li nasconde) + /// + public List GetLastDescFull(DateTime DtStart, DateTime DtEnd, bool DtIsCreation, int NumRecord, bool OnlyActive, string Machine = "", string BtlFileName = "", string ListName = "", bool ShowArchived = false) + { + List result = new List(); + List dbResultProd = new List(); + // elenco proj "orfani" + List dbResultProj = new List(); + using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) + { + // se numRecord = 0 --> passo tutti + if (NumRecord == 0) + { + NumRecord = localDbCtx.ProdList.Count(); + } + // retrieve + dbResultProd = localDbCtx + .ProdList + .Where(x => (!x.IsArchived || ShowArchived)) + // condizione join sui PROJ + .Join(localDbCtx.ProjList.Where(x => + (x.IsActive || !OnlyActive) + && (string.IsNullOrEmpty(Machine) || x.Machine == Machine) + && (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName == BtlFileName) + && (string.IsNullOrEmpty(ListName) || x.ListName == ListName) + && ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd))) + ), + p => p.ProdDbId, + e => e.ProdDbId, + (p, e) => p) + .Distinct() + .Include(j => j.ProjListNav) + .OrderByDescending(x => x.ProdId) + .Take(NumRecord) + .ToList(); + + // recupero i proj "orfani" + dbResultProj = localDbCtx + .ProjList + .Where(x => + (x.IsActive || !OnlyActive) + && x.Prod == null + && (string.IsNullOrEmpty(Machine) || x.Machine == Machine) + && (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName == BtlFileName) + && (string.IsNullOrEmpty(ListName) || x.ListName == ListName) + && ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd)))) + .OrderByDescending(x => x.ProjId) + .Take(NumRecord) + .ToList(); + } // conversione result = dbResultProd.Select(x => coreItemConv(x)).ToList(); var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList(); From c32715a4b5187b78714dbc9a7be2bf9bbbec4274 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 2 Oct 2023 09:43:46 +0200 Subject: [PATCH 014/126] fix ricerca contains --- EgtBEAMWALL.DataLayer/Controllers/ProdController.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs index f7861d52..4d64c555 100644 --- a/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs +++ b/EgtBEAMWALL.DataLayer/Controllers/ProdController.cs @@ -427,9 +427,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers // condizione join sui PROJ .Join(localDbCtx.ProjList.Where(x => (x.IsActive || !OnlyActive) - && (string.IsNullOrEmpty(Machine) || x.Machine == Machine) - && (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName == BtlFileName) - && (string.IsNullOrEmpty(ListName) || x.ListName == ListName) + && (string.IsNullOrEmpty(Machine) || x.Machine.ToLower().Contains(Machine.ToLower())) + && (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName.ToLower().Contains( BtlFileName.ToLower())) + && (string.IsNullOrEmpty(ListName) || x.ListName.ToLower().Contains(ListName.ToLower())) && ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd))) ), p => p.ProdDbId, @@ -447,9 +447,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers .Where(x => (x.IsActive || !OnlyActive) && x.Prod == null - && (string.IsNullOrEmpty(Machine) || x.Machine == Machine) - && (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName == BtlFileName) - && (string.IsNullOrEmpty(ListName) || x.ListName == ListName) + && (string.IsNullOrEmpty(Machine) || x.Machine.ToLower().Contains(Machine.ToLower())) + && (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName.ToLower().Contains(BtlFileName.ToLower())) + && (string.IsNullOrEmpty(ListName) || x.ListName.ToLower().Contains(ListName.ToLower())) && ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd)))) .OrderByDescending(x => x.ProjId) .Take(NumRecord) From 7cd0fdd14a210c73dba146b0a8fb0dc051d72bf0 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 4 Oct 2023 17:24:35 +0200 Subject: [PATCH 015/126] Modifica procedura web browser --- EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb index cfd46754..ffb90fe5 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb @@ -402,9 +402,13 @@ Public Class WebBrowserUtility Public Shared Sub BindableSourcePropertyChanged(o As DependencyObject, e As DependencyPropertyChangedEventArgs) Dim browser As WebBrowser = TryCast(o, WebBrowser) - If browser IsNot Nothing Then + If Not IsNothing(browser) Then Dim uri As String = TryCast(e.NewValue, String) - browser.Source = If(uri IsNot Nothing, New Uri(uri), Nothing) + If Not IsNothing(uri) Then + browser.Source = New Uri(uri) + Else + browser.Source = Nothing + End If End If End Sub End Class From 23b2606cbcf77db4a5e4bcca7382a93c92ba6ef3 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Mon, 9 Oct 2023 11:14:02 +0200 Subject: [PATCH 016/126] - aggiunta Action a ProdItem per gestire update Nome su DB - rimosso ProdItem da ViewerOptimizer --- EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb | 15 +++++---- .../NewOpenProjectFileDialogVM.vb | 31 +------------------ .../Utility/DbControllers.vb | 2 -- 3 files changed, 10 insertions(+), 38 deletions(-) diff --git a/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb b/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb index 5bb31bb0..0269c5b4 100644 --- a/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb +++ b/EgtBEAMWALL.Core/ProjectFileVM/ProdItem.vb @@ -5,9 +5,10 @@ Imports System.Windows Public Class ProdItem Inherits VMBase - Public Shared m_delIsModifiedSetUp As Action(Of Boolean) + Public Shared m_delUpdateNameInDb As Action(Of Integer, String) + Public Shared m_delIsModifiedSetUp As Action(Of Boolean) - Protected m_ProdFileVM As ProdFileVM + Protected m_ProdFileVM As ProdFileVM Public ReadOnly Property ProdFileVM As ProdFileVM Get Return m_ProdFileVM @@ -32,10 +33,12 @@ Public Class ProdItem Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "") End Get Set(value As String) - If Not IsNothing(m_ProdFileVM) Then - m_ProdFileVM.sName = value - End If - End Set + If Not IsNothing(m_ProdFileVM) Then + m_delUpdateNameInDb(m_ProdFileVM.nProdId, value) + m_ProdFileVM.sName = value + m_delIsModifiedSetUp(False) + End If + End Set End Property Public ReadOnly Property dtCreateDate As Date diff --git a/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb b/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb index 95c4c6d4..b2d64428 100644 --- a/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb @@ -22,6 +22,7 @@ Public Class NewOpenProjectFileDialogVM Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean? m_ProjectType = ProjectType + ProdItem.m_delUpdateNameInDb = AddressOf DbControllers.m_ProdController.UpdateDescription NotifyPropertyChanged(NameOf(FilterTypeList)) m_SelFilterType = m_FilterTypeList(0) @@ -250,33 +251,3 @@ Public Class NewOpenProjectFileDialogVM #End Region ' METHODS End Class - -Public Class ProdItem - Inherits Core.ProdItem - - Public Overrides Property sName As String - Get - Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "") - End Get - Set(value As String) - If Not IsNothing(m_ProdFileVM) Then - DbControllers.m_ProdController.UpdateDescription(m_ProdFileVM.nProdId, value) - m_ProdFileVM.sName = value - m_delIsModifiedSetUp(False) - End If - End Set - End Property - - Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM) - MyBase.New(ProdFileVM, ProjFileVM) - End Sub - - Sub New(ProjFileVM As ProjFileVM) - MyBase.New(ProjFileVM) - End Sub - - Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM)) - MyBase.New(ProdFileVM, ProjFileVMList) - End Sub - -End Class \ No newline at end of file diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/DbControllers.vb b/EgtBEAMWALL.ViewerOptimizer/Utility/DbControllers.vb index a19d80b0..8b6f680e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/DbControllers.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/DbControllers.vb @@ -68,8 +68,6 @@ Public Module DbControllers DataLayer.DbConfig.CheckMigrateDb() DataLayer.DbConfig.CheckUser(sUser, sPwd, m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK)) DataLayer.DbConfig.CheckViews(sUser, sPwd) - ' riattivare il dump per il backup - 'DataLayer.DbConfig.DumpDB("C:\Program Files\MariaDB 10.5\bin\mysqldump", "c:\Temp\Pippo.sql") If m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then ' imposto cartella condivisa GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataDir, sSharedFolder) From fe0db46b69e5f9bd872d82e23ec4e49ab40286da Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 24 Oct 2023 18:08:57 +0200 Subject: [PATCH 017/126] Creazione nuova pagina che unisce visualizzatore e ottimizzatore --- EgtBEAMWALL.Core/Constants/ConstDims.vb | 1 + EgtBEAMWALL.Core/Constants/ConstGen.vb | 1 + EgtBEAMWALL.Core/Constants/ConstIni.vb | 2 + .../BTLViewModel/BTLFeatureVM.vb | 4 +- .../BTLViewModel/BTLStructureVM.vb | 20 +- .../BottomPanel/BottomPanelV.xaml | 6 +- .../BottomPanel/BottomPanelVM.vb | 2 + .../EgtBEAMWALL.ViewerOptimizer.vbproj | 22 + .../InstrumentPanel/InstrumentPanelV.xaml | 17 +- .../InstrumentPanel/MyInstrumentPanelVM.vb | 100 + .../ItemParamList/PartParametersV.xaml | 650 +++---- .../LeftPanel/LeftPanelV.xaml | 6 +- .../LeftPanel/LeftPanelVM.vb | 4 +- .../LeftPanel/OnlyProdLeftPanelV.xaml | 159 ++ .../LeftPanel/OnlyProdLeftPanelV.xaml.vb | 3 + .../MainMenu/MainMenuV.xaml | 6 + .../MainMenu/MainMenuVM.vb | 222 ++- .../MainWindow/MainWindowM.vb | 9 + .../MainWindow/MainWindowV.xaml | 4 +- .../MainWindow/MainWindowVM.vb | 45 +- .../OnlyProdManager/OnlyProdManagerV.vb | 3 + .../OnlyProdManager/OnlyProdManagerV.xaml | 72 + .../OnlyProdManager/OnlyProdManagerVM.vb | 1713 +++++++++++++++++ .../OnlyProdProject/OnlyProdProjectV.xaml | 328 ++++ .../OnlyProdProject/OnlyProdProjectV.xaml.vb | 3 + .../OnlyProdProject/OnlyProdProjectVM.vb | 448 +++++ .../OptimizePanel/OptimizePanelVM.vb | 17 +- .../ProdManager/ProdManagerV.xaml | 17 +- .../ProdManager/ProdManagerVM.vb | 7 + .../ProjManager/ProjManagerV.xaml | 1 + .../ProjManager/ProjManagerVM.vb | 6 + .../Project/ProjectV.xaml | 7 +- .../Project/ProjectVM.vb | 138 +- .../SceneHost/MySceneHostVM.vb | 68 +- .../StatisticsTimePanelVM.vb | 2 +- .../TopPanel/TopPanelV.xaml | 2 +- .../Utility/Dictionary.xaml | 1 + EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb | 13 + 38 files changed, 3721 insertions(+), 408 deletions(-) create mode 100644 EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerV.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectVM.vb diff --git a/EgtBEAMWALL.Core/Constants/ConstDims.vb b/EgtBEAMWALL.Core/Constants/ConstDims.vb index 1d56999a..d50342f1 100644 --- a/EgtBEAMWALL.Core/Constants/ConstDims.vb +++ b/EgtBEAMWALL.Core/Constants/ConstDims.vb @@ -9,5 +9,6 @@ Public Const TOPPANEL_OPTIMIZER As String = "TopPanel_Optimizer" Public Const LEFTPANEL_SUPERVISOR As String = "LeftPanel_Supervisor" Public Const PROJECT_SUPERVISOR As String = "Project_Supervisor" + Public Const PROJECT_ONLYPROD As String = "Project_OnlyProd" End Class diff --git a/EgtBEAMWALL.Core/Constants/ConstGen.vb b/EgtBEAMWALL.Core/Constants/ConstGen.vb index ced9eb40..73a94d78 100644 --- a/EgtBEAMWALL.Core/Constants/ConstGen.vb +++ b/EgtBEAMWALL.Core/Constants/ConstGen.vb @@ -33,6 +33,7 @@ Public Module ConstGen CONFIG = 3 INPUTS = 4 OUTPUTS = 5 + ONLYPRODPAGE = 6 End Enum ' Abilitazioni licenza diff --git a/EgtBEAMWALL.Core/Constants/ConstIni.vb b/EgtBEAMWALL.Core/Constants/ConstIni.vb index 1b0bd759..ddb25cc7 100644 --- a/EgtBEAMWALL.Core/Constants/ConstIni.vb +++ b/EgtBEAMWALL.Core/Constants/ConstIni.vb @@ -168,4 +168,6 @@ Public Module ConstIni Public Const K_EXTERNALFILEPATH As String = "ExternalFilePath" Public Const K_REMINDERFREQUENCY As String = "ReminderFrequency" + Public Const K_ONLYPROD As String = "OnlyProd" + End Module diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLFeatureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLFeatureVM.vb index 7ab66f7d..09a28cae 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLFeatureVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLFeatureVM.vb @@ -209,7 +209,7 @@ Public Class BTLFeatureVM m_SelPBTLParam = value If Not IsNothing(m_SelPBTLParam) Then ' imposto path disegno da mostrare in BottomPanel - Map.refBottomPanelVM.SetCurrDraw(m_SelPBTLParam.sDrawPath) + If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetCurrDraw(m_SelPBTLParam.sDrawPath) End If NotifyPropertyChanged(NameOf(SelPBTLParam)) End Set @@ -232,7 +232,7 @@ Public Class BTLFeatureVM End Get Set(value As BTLParamVM) m_SelQParam = value - If Not IsNothing(m_SelQParam) Then + If Not IsNothing(m_SelQParam) AndAlso Not IsNothing(Map.refBottomPanelVM) Then ' imposto path disegno da mostrare in BottomPanel Map.refBottomPanelVM.SetCurrDraw(m_SelQParam.sDrawPath) End If diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb index e2dd39b6..83fe3388 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb @@ -150,7 +150,7 @@ Public Class BTLStructureVM Select Case e.Action Case NotifyCollectionChangedAction.Add If e.NewItems.Count > 0 AndAlso Not IsNothing(e.NewItems(0)) Then - If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso m_SelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING Then + If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso m_SelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso m_SelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then SelectBTLPart(e.NewItems(0)) Else ' SelectionTypes.HIGHLIGHT HighlightBTLPart(e.NewItems(0)) @@ -182,8 +182,8 @@ Public Class BTLStructureVM End Sub Private Sub SelectBTLPart(BtlPart As BTLPartVM) - EgtBeamShowFacesName( False) - EgtBeamShowLoadingSide( False, False) + EgtBeamShowFacesName(False) + EgtBeamShowLoadingSide(False, False) m_SelBTLPart = BtlPart If Map.refMainMenuVM.SelPage = Pages.VIEW Then ' se modalità building, la tolgo @@ -194,10 +194,10 @@ Public Class BTLStructureVM SceneSelPartSelection() ' seleziono pezzo in Db geometrico EgtBeamSetPart(BtlPart.nPartId) - EgtBeamShowFacesName( True) + EgtBeamShowFacesName(True) Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM) - Dim bLeftToRight As Boolean = Not ( CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) - EgtBeamShowLoadingSide( bLoadingSideShow, bLeftToRight) + Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) + EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight) ' seleziono pagina BottomPanel Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART) '' mostro barra di gestione pezzo @@ -208,7 +208,7 @@ Public Class BTLStructureVM Map.refShowBeamPanelVM.bShowAll = False Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) EgtZoom(ZM.ALL) - ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then + ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then ' resetto gruppo di lavorazione corrente EgtResetCurrMachGroup() ' trovo ed evidenzio MachGroup e Duplo di questo pezzo @@ -246,8 +246,8 @@ Public Class BTLStructureVM Map.refProjectVM.BTLStructureVM.ShowSolid(BtlPart.nPartId, False, False) End If If m_SelBTLPart Is BtlPart Then - EgtBeamShowFacesName( False) - EgtBeamShowLoadingSide( False, False) + EgtBeamShowFacesName(False) + EgtBeamShowLoadingSide(False, False) m_SelBTLPart = Nothing NotifyPropertyChanged(NameOf(SelBTLPart)) End If @@ -617,6 +617,8 @@ Public Class BTLStructureVM Return Map.refProjManagerVM.nProjType Case Pages.MACHINING Return Map.refProdManagerVM.nProdType + Case Pages.ONLYPRODPAGE + Return Map.refProdManagerVM.nProdType Case Else Return BWType.NULL End Select diff --git a/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelV.xaml index 89d9455a..c8466cfa 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelV.xaml @@ -33,8 +33,8 @@ + Tag="{Binding Tag.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}" + Margin="5"/> + Margin="5"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelVM.vb index eb3039ec..ea86d27b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelVM.vb @@ -23,6 +23,8 @@ Public Class BottomPanelVM Friend Sub SetSelPartFeatureTab(SelPartFeatureTab As PartFeatureTab) If m_SelPartFeatureTab = PartFeatureTab.STATISTICS Then Map.refInstrumentPanelVM.SetStatisticsIsChecked(False) + 'Map.refInstrumentPanelVM.SetVisStatistic_IsChecked(False) + 'Map.refInstrumentPanelVM.SetOtStatistic_IsChecked(False) End If m_SelPartFeatureTab = SelPartFeatureTab NotifyPropertyChanged(NameOf(SelPartFeatureTab)) diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index 4138ed9f..0370788c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -263,6 +263,13 @@ + + OnlyProdLeftPanelV.xaml + + + OnlyProdManagerV.xaml + + MovePartInRawPartWndV.xaml @@ -328,6 +335,9 @@ + + OnlyProdProjectV.xaml + ProjectTypeWndV.xaml @@ -472,6 +482,14 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -536,6 +554,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml index 2d9d56e2..b71cb984 100644 --- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml @@ -39,9 +39,24 @@ - + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb index 94982a46..b0482988 100644 --- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb @@ -19,6 +19,24 @@ Public Class MyInstrumentPanelVM End Get End Property + Public ReadOnly Property Statistic_Visibility As Visibility + Get + Return If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + + Public ReadOnly Property VisStatistic_Visibility As Visibility + Get + Return If(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + + Public ReadOnly Property OtStatistic_Visibility As Visibility + Get + Return If(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + Private m_InstrumentPanel_IsEnabled As Boolean = True Public Property InstrumentPanel_IsEnabled As Boolean Get @@ -79,6 +97,82 @@ Public Class MyInstrumentPanelVM NotifyPropertyChanged(NameOf(Statistics_IsChecked)) End Sub + Private m_VisStatistic_IsEnabled As Boolean = True + Public Property VisStatistic_IsEnabled As Boolean + Get + Return m_VisStatistic_IsEnabled + End Get + Set(value As Boolean) + m_VisStatistic_IsEnabled = value + 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 + Return m_OtStatistic_IsEnabled + End Get + Set(value As Boolean) + m_OtStatistic_IsEnabled = value + End Set + End Property + + Private m_OtStatistic_IsChecked As Boolean = False + Public Property OtStatistic_IsChecked As Boolean + Get + Return m_OtStatistic_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(Map.refProdManagerVM.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 + 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 Private m_cmdChangeParameter As ICommand @@ -139,10 +233,16 @@ Public Class MyInstrumentPanelVM NotifyPropertyChanged(NameOf(InstrumentPanel_IsEnabled)) If Map.refFreeContourManagerVM.bIsActive Then m_Statistics_IsEnabled = bIsEnabled + m_VisStatistic_IsEnabled = bIsEnabled + m_OtStatistic_IsEnabled = bIsEnabled Else m_Statistics_IsEnabled = True + m_VisStatistic_IsEnabled = True + m_OtStatistic_IsEnabled = True End If NotifyPropertyChanged(NameOf(Statistics_IsEnabled)) + NotifyPropertyChanged(NameOf(VisStatistic_IsEnabled)) + NotifyPropertyChanged(NameOf(OtStatistic_IsEnabled)) End Sub #End Region ' METHODS diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartParametersV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartParametersV.xaml index 5d157037..dde4a1b5 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartParametersV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartParametersV.xaml @@ -18,191 +18,191 @@ - - + + + + + + + + + + + - - + + - - + + - - - - - - - - - - - - - - - - - - + - - - - - - - - - - + + + + + + + + + + + Tag="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}" + Grid.Row="1"/> @@ -195,7 +195,7 @@ - diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index c7980a36..117b7c9b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -22,12 +22,12 @@ Public Class LeftPanelVM Public ReadOnly Property ViewPage_Visibility As Visibility Get - Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, Visibility.Visible, Visibility.Collapsed) + Return If(Map.refMainMenuVM.SelPage = Pages.VIEW Or Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) End Get End Property Public ReadOnly Property MachiningPage_Visibility As Visibility Get - Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING, Visibility.Visible, Visibility.Collapsed) + Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING Or Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) End Get End Property diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml new file mode 100644 index 00000000..d3613d2b --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml.vb new file mode 100644 index 00000000..c991aa65 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdLeftPanelV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuV.xaml b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuV.xaml index 2a17c782..1e9c1ea1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuV.xaml @@ -6,11 +6,17 @@ + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb new file mode 100644 index 00000000..4639b550 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb @@ -0,0 +1,1713 @@ +Imports EgtWPFLib5 +Imports EgtBEAMWALL.Core +Imports EgtUILib +Imports System.Collections.ObjectModel +Imports System.IO +Imports EgtBEAMWALL.DataLayer.DatabaseModels +Imports System.Windows.Threading + +Public Class OnlyProdManagerVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + ' Nome file NGE con i pezzi selezionati per effettuare UpdateBTL + Friend Const UPDATEBTL_NGE As String = "UpdateBTL.nge" + + Private m_OpenProj_Timer As New DispatcherTimer + Private m_bOpenProj As Boolean = False + Private m_nProjIdToOpen As Integer = GDB_ID.NULL + + Private m_FullCompleteManager_IsEnabled As Boolean = True + Public ReadOnly Property FullCompleteManager_IsEnabled As Boolean + Get + Return m_FullCompleteManager_IsEnabled + End Get + End Property + Friend Sub SetProdManagerIsEnabled(bIsEnabled As Boolean) + m_FullCompleteManager_IsEnabled = bIsEnabled + NotifyPropertyChanged(NameOf(FullCompleteManager_IsEnabled)) + End Sub + + Private m_CurrProj As ProjFileVM + Friend Property CurrProj As ProjFileVM + Get + Return m_CurrProj + End Get + Set(value As ProjFileVM) + m_CurrProj = value + End Set + End Property + + Private m_CurrProd As ProdFileVM + Friend Property CurrProd As ProdFileVM + Get + Return m_CurrProd + End Get + Set(value As ProdFileVM) + m_CurrProd = value + End Set + End Property + + Private m_TempCurrProd As ProdFileVM + Friend Property TempCurrProd As ProdFileVM + Get + Return m_TempCurrProd + End Get + Set(value As ProdFileVM) + m_TempCurrProd = value + End Set + End Property + + ' indice progetto in caricamento + Private m_nLoadingProjId As Integer = 0 + Public ReadOnly Property nLoadingProjId As Integer + Get + Return m_nLoadingProjId + End Get + End Property + + Friend m_MruFiles As New MruList + Public ReadOnly Property MruFileNames As ObservableCollection(Of String) + Get + Dim IdAndBTLFileNames As New ObservableCollection(Of String) + For Each FileName In m_MruFiles.FileNames.ToList() + Dim PjId As Integer = 0 + Dim sPjId As String = Path.GetFileNameWithoutExtension(DirectCast(FileName, String).Replace("__", "_")) + Integer.TryParse(sPjId, PjId) + Dim PjFileM = DbControllers.m_ProjController.FindByProjIdConv(PjId) + If IsNothing(PjFileM) Then + m_MruFiles.Remove(FileName) + Else + IdAndBTLFileNames.Add(sPjId & " | " & PjFileM.sBTLFileName) + End If + Next + Return IdAndBTLFileNames + End Get + End Property + + Private m_GoToSupervisor_Visibility As Visibility + Public ReadOnly Property GoToSupervisor_Visibility As Visibility + Get + Return m_GoToSupervisor_Visibility + End Get + End Property + + Private m_UpdateBTL_Visibility As Visibility = Visibility.Collapsed + Public Property UpdateBTL_Visibility As Visibility + Get + Return m_UpdateBTL_Visibility + End Get + Set(value As Visibility) + m_UpdateBTL_Visibility = value + End Set + End Property + + Private m_AddProj_Visibility As Visibility + Public ReadOnly Property AddProj_Visibility As Visibility + Get + Return m_AddProj_Visibility + End Get + End Property + + ' indice ultimo progetto + Private m_nLastProdId As Integer + Friend ReadOnly Property nLastProdId As Integer + Get + Return m_nLastProdId + End Get + End Property + + ' Definizione comandi + Private m_cmdNew As ICommand + Private m_cmdOpen As ICommand + Private m_cmdSave As ICommand + Private m_cmdImportBTL As ICommand + Private m_cmdUpdateBTL As ICommand + Private m_cmdExportProject As ICommand + Private m_cmdImportProject As ICommand + Private m_cmdGoToSupervisor As ICommand + +#Region "ToolTip" + + 'Proprietà ToolTip + Public ReadOnly Property NewToolTip As String + Get + Return EgtMsg(MSG_TOPCOMMANDBAR + 1) + End Get + End Property + Public ReadOnly Property OpenToolTip As String + Get + Return EgtMsg(MSG_TOPCOMMANDBAR + 2) + End Get + End Property + Public ReadOnly Property SaveToolTip As String + Get + Return EgtMsg(MSG_TOPCOMMANDBAR + 3) + End Get + End Property + Public ReadOnly Property SaveAsToolTip As String + Get + Return EgtMsg(MSG_TOPCOMMANDBAR + 4) + End Get + End Property + Public ReadOnly Property ImportBTL_ToolTip As String + Get + Return EgtMsg(61840) + End Get + End Property + Public ReadOnly Property UpdateBTL_ToolTip As String + Get + Return EgtMsg(61834) + End Get + End Property + Public ReadOnly Property ImportProject_ToolTip As String + Get + Return EgtMsg(61839) + End Get + End Property + Public ReadOnly Property GoToProd_ToolTip As String + Get + Return EgtMsg(61835) + End Get + End Property + Public ReadOnly Property GoToSupervisor_ToolTip As String + Get + Return EgtMsg(61974) + End Get + End Property + +#End Region ' ToolTip + +#End Region ' Field & Properties + +#Region "CONSTRUCTORS" + + Sub New() + Map.SetRefOnlyProdManagerVM(Me) + ' Leggo ultimo indice di progetto + m_nLastProdId = GetMainPrivateProfileInt(S_GENERAL, K_PROJSINDEX, 1) + ' Impostazioni MruLists + m_MruFiles.Init(S_MRUPROJFILES, 8) + ' leggo attivazione update btl + If GetMainPrivateProfileInt(S_GENERAL, K_UPDATEBTL, 0) > 0 Then + UpdateBTL_Visibility = Visibility.Visible + End If + + ' abilito passaggio a supervisore + If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.SUPERVISOR) Then + m_GoToSupervisor_Visibility = Visibility.Visible + Else + m_GoToSupervisor_Visibility = Visibility.Collapsed + End If + + ' attivo bottone AddProj + If GetMainPrivateProfileInt(S_GENERAL, K_ADDPROJ, 0) = 1 Then + m_AddProj_Visibility = Visibility.Visible + Else + m_AddProj_Visibility = Visibility.Collapsed + End If + ' 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 ' Constructors + +#Region "METHODS" + + Public Function SetCurrProj(nProjId As Integer) As Boolean + Dim Currproj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(nProjId) + If IsNothing(Currproj) Then Return False + m_CurrProj = New ProjFileVM(Currproj) + Return True + End Function + + Private Function InitNewProject(ByRef nProjId As Integer, ByRef sProjectDir As String, nType As BWType, Machine As Machine) As Boolean + ' se non ho ricevuto numero progetto da sovrascrivere + If nProjId = 0 Then + ' richiedo indice nuovo progetto + nProjId = DbControllers.m_ProjController.GetNextIndex(Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + End If + ' salvo data creazione progetto + DbControllers.m_ProjController.Update(New ProjModel() With {.ProjId = nProjId, + .DtCreated = DateTime.Now(), + .PType = nType, + .Machine = If(Not IsNothing(Machine), Machine.Name, Nothing)}) + If nProjId <= 0 Then Return False + sProjectDir = refMainWindowVM.MainWindowM.sProjsDir & "\" & nProjId.ToString("0000") + ' creo cartella nuovo progetto + If Not Directory.Exists(sProjectDir) Then + Directory.CreateDirectory(sProjectDir) + Else + Dim di As System.IO.DirectoryInfo = New DirectoryInfo(sProjectDir) + For Each file As FileInfo In di.EnumerateFiles() + file.Delete() + Next + For Each dir As DirectoryInfo In di.EnumerateDirectories() + dir.Delete(True) + Next + End If + Return True + End Function + + Private Sub ReloadBTLStructure() + Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId)) + ' verifico se volume pezzi calcolato + Dim bIsCalculated As Boolean = False + For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList + If BTLPart.BTLPartM.dVolume > 0 Then Continue For + bIsCalculated = True + BTLPart.CalcBTLPartVolume() + Next + If bIsCalculated Then + Dim CurrProject As String = "" + EgtGetCurrFilePath(CurrProject) + EgtSaveFile(CurrProject, NGE.CMPTEXT) + End If + End Sub + + Public Function SetCurrProd(nProdId As Integer) As Boolean + Dim CurrProdM As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(nProdId) + If IsNothing(CurrProdM) Then Return False + m_CurrProd = New ProdFileVM(CurrProdM) + Return True + End Function + + Public Sub OpenProject_Tick() + If Not m_bOpenProj Then Return + m_bOpenProj = False + Select Case Map.refMainMenuVM.SelPage + Case Pages.MACHINING + ' recupero progetto da Id + Dim DbProject As ProdFileM + DbProject = DbControllers.m_ProdController.FindCoreByProdId(m_nProjIdToOpen) + Dim ProjectVM As New ProdFileVM(DbProject) + ' verifico se progetto modificato, e chiedo se salvare + If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then Return + OpenProject(ProjectVM) + Case Pages.VIEW + ' verifico se progetto modificato, e chiedo se salvare + If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then Return + LoadingWndHelper.OpenLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63004), EgtMsg(63011), 10) ' Optimization opening ' Loading environment + If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso (m_nProjIdToOpen <> Map.refProjManagerVM.CurrProj.nProdId OrElse IsNothing(Map.refProdManagerVM.CurrProd)) Then + Map.refProdManagerVM.SetCurrProd(m_nProjIdToOpen) + Map.refProdManagerVM.CurrProd.SetReloadProject(True) + Else + Map.refProdManagerVM.CurrProd.SetReloadProject(False) + End If + ' Ricavo il tipo di Warehouse settato nell'INI + Dim nDefault As Integer = 2 + If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM Then + ' Se di tipo Medium confronto le Sezioni del BTL importato con quelle in Warehouse + WarehouseWndVM.UpdateSectionXMaterial() + End If + ' vado in pagina prod + Map.refMainMenuVM.SetSelPage(Pages.MACHINING, False) + ' aggiorno titolo + Map.refMainWindowVM.UpdateTitle() + LoadingWndHelper.CloseLoadingWnd(ActiveIds.GOTOPROD) + End Select + m_nProjIdToOpen = GDB_ID.NULL + End Sub + +#End Region ' Methods + +#Region "COMMANDS" + +#Region "New" + + ''' + ''' Returns a command that do New. + ''' + Public ReadOnly Property New_Command As ICommand + Get + If m_cmdNew Is Nothing Then + m_cmdNew = New Command(AddressOf NewProject) + End If + Return m_cmdNew + End Get + End Property + + ''' + ''' Execute the New. This method is invoked by the NewCommand. + ''' + Public Sub NewProject() + ' verifico se progetto modificato, e chiedo se salvare + If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return + ' se si ha una sola macchina disponibile (non BOTH) setto il nuovo porgetto a quella macchina e al tipo progetto associato + ' altrimenti apro il dialog per scegliere la macchina e il tipo progetto a cui settare il nuovo progetto + Dim Machine As Machine = Nothing + Dim nType As BWType = BWType.NULL + Dim ProjectTypeWndVM As New ProjectTypeWndVM() + If ProjectTypeWndVM.MachineList.Count = 1 AndAlso DirectCast(ProjectTypeWndVM.SelMachine, MyMachine).nType <> MachineType.BOTH Then + Machine = ProjectTypeWndVM.SelMachine + nType = DirectCast(Machine, MyMachine).nType + Else + Dim ProjectTypeWnd As New ProjectTypeWndV(Application.Current.MainWindow, ProjectTypeWndVM) + If ProjectTypeWnd.ShowDialog() Then + Machine = ProjectTypeWndVM.SelMachine + nType = ProjectTypeWndVM.nSelType + Else + Return + End If + End If + ' creo nuovo progetto + If Map.refSceneHostVM.MainController.NewProject() Then + ' inizializzo nuovo progetto + Dim nProjId As Integer = 0 + Dim sProjDir As String = "" + InitNewProject(nProjId, sProjDir, nType, Machine) + SetCurrProj(nProjId) + ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel + Map.refCALCPanelVM.LoadMachineList() + Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge" + ' imposto ProjId di caricamento + m_nLoadingProjId = nProjId + ' creo gruppo BTLinfo + Dim nBTLInfoLayer As Integer = EgtCreateGroup(GDB_ID.ROOT) + EgtSetName(nBTLInfoLayer, BTLINFO) + EgtSetLevel(nBTLInfoLayer, GDB_LV.SYSTEM) + Map.refProjectVM.BTLStructureVM.BTLStructureM.UpdateBTLInfoLayer() + ' scrivo info proj e tipo su layer BtlInfo + EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, nProjId) + EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, nType) + ' salvo il progetto + If EgtSaveFile(sProjFileName, NGE.CMPTEXT) Then + SectionXMaterial.SetType(nType) + Core.ViewPanelVM.UpdateBWType(nType) + Map.refPartManagerVM.LockVisibilityUpdate() + ' imposto flag secondo tipo di progetto (travi o pareti) + Dim sBTLFlag As String = If(nType = Core.ConstBeam.BWType.BEAM, K_BTLFLAG, K_WALLBTLFLAG) + Dim nFlag As Integer = GetMainPrivateProfileInt(S_IMPORT, sBTLFlag, EIB_FL.TS3_POS + EIB_FL.SORT + EIB_FL.USEUATTR) + EgtBeamSetFlag(nFlag) + DbControllers.m_ProjController.UpdateInfo(nProjId, "Hand made", "Hand made", "", Date.MinValue, nType, Map.refMachinePanelVM.SelectedMachine.Name) + SetCurrProj(nProjId) + End If + Map.refProjectVM.SetOptimizePanel_Visibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO)) + Else + MessageBox.Show(EgtMsg(61876)) + End If + Map.refMainWindowVM.UpdateTitle() + NotifyPropertyChanged(NameOf(MruFileNames)) + End Sub + +#End Region ' New + +#Region "OpenCommand" + + ''' + ''' Returns a command that do Open. + ''' + Public ReadOnly Property OpenCommand As ICommand + Get + If m_cmdOpen Is Nothing Then + m_cmdOpen = New Command(AddressOf Open) + End If + Return m_cmdOpen + End Get + End Property + + ''' + ''' Execute the Open. This method is invoked by the OpenCommand. + ''' + Friend Sub Open() + ' verifico se progetto modificato, e chiedo se salvare + If ProdFileVM.VerifyProjectModification(CurrProd) = MessageBoxResult.Cancel Then Return + OpenProject(Nothing) + End Sub + + Friend Sub OpenProject(TempCurrPd As ProdFileVM) + m_TempCurrProd = TempCurrPd + Dim sFilePath As String = "" + ' se la string è vuota + If IsNothing(TempCurrProd) Then + If GetMainPrivateProfileInt(S_GENERAL, K_PROJECTMODE, 0) = 1 Then + Dim OpenProdFileDialogVM As NewOpenProjectFileDialogVM = Nothing + ' apro dialogo di scelta Prod + OpenProdFileDialogVM = New NewOpenProjectFileDialogVM + Dim OpenFile As New NewOpenProjectFileDialogV(Application.Current.MainWindow, OpenProdFileDialogVM) + Dim DialogResult As Boolean? = OpenFile.EgtShowDialog(ProjectType.PROD) + If IsNothing(DialogResult) OrElse Not DialogResult Then Return + sFilePath = OpenProdFileDialogVM.SelProject.ProdFileVM.sProdPath + m_TempCurrProd = OpenProdFileDialogVM.SelProject.ProdFileVM + Else + Dim OpenProjectFileDialogVM As OpenProjectFileDialogVM = Nothing + ' apro dialogo di scelta file + OpenProjectFileDialogVM = New OpenProjectFileDialogVM + Dim OpenFile As New OpenProjectFileDialogV(Application.Current.MainWindow, OpenProjectFileDialogVM) + Dim DialogResult As Boolean? = OpenFile.EgtShowDialog(ProjectType.PROD) + If IsNothing(DialogResult) OrElse Not DialogResult Then Return + sFilePath = OpenProjectFileDialogVM.SelProject.sProdPath + TempCurrProd = OpenProjectFileDialogVM.SelProject + End If + Else + sFilePath = If(Not IsNothing(TempCurrProd.sProdPath), TempCurrProd.sProdPath, "") + End If + LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63004), EgtMsg(63001), 50) ' Optimization opening ' Loading project geometries + If File.Exists(sFilePath) Then + ' se la macchina del progetto in apertura non è tra le macchine disponibili lo segnalo e apro un progetto vuoto + If IsNothing(Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.TempCurrProd.sMachine)) Then + ' rimuovo il file in apertura dalla lista degli MRU + Map.refOnlyProdManagerVM.m_MruFiles.Remove(sFilePath) + MessageBox.Show(EgtMsg(61885), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + Map.refOnlyProdManagerVM.NewProject() + Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList())) + Else + If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then + Map.refProjectVM.SetOptimizePanel_Visibility(True) + Map.refTopPanelVM.UpdateQParameterVisibility() + End If + End If + ' imposto flag secondo tipo di progetto (travi o pareti) + Dim sBTLFlag As String = If(TempCurrProd.nType = Core.ConstBeam.BWType.BEAM, K_BTLFLAG, K_WALLBTLFLAG) + Dim nFlag As Integer = GetMainPrivateProfileInt(S_IMPORT, sBTLFlag, EIB_FL.TS3_POS + EIB_FL.SORT + EIB_FL.USEUATTR) + EgtBeamSetFlag(nFlag) + Else + MessageBox.Show(EgtMsg(61871)) + Map.refSceneHostVM.MainController.NewProject() + Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL") + End If + ' aggiorno lista possibili nesting + Map.refOptimizePanelVM.UpdateOriginTypeList(EgtGetFirstNameInGroup(GDB_ID.ROOT, "RawParts") <> GDB_ID.NULL) + ' aggiorno visibilità bottone Muovi pezzi + Map.refTopPanelVM.UpdateMovePartInRawPartVisibility() + ' resetto eventuale visualizzazione statistiche + Map.refInstrumentPanelVM.ResetStatisticsIsChecked() + ' aggiorno titolo + Map.refMainWindowVM.UpdateTitle() + NotifyPropertyChanged(NameOf(MruFileNames)) + LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD) + End Sub + +#End Region ' OpenCommand + +#Region "SaveCommand" + + ''' + ''' Returns a command that do Save. + ''' + Public ReadOnly Property SaveCommand As ICommand + Get + If m_cmdSave Is Nothing Then + m_cmdSave = New Command(AddressOf SaveCmd) + End If + Return m_cmdSave + End Get + End Property + + ''' + ''' Execute the Save. This method is invoked by the SaveCommand. + ''' + Public Sub SaveCmd() + Save(True) + End Sub + + Public Function Save(Optional bShowLoading As Boolean = False) As Boolean + If IsNothing(CurrProd) Then Return False + If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63007), EgtMsg(63012), 70) ' Project saving ' Saving geometry + Dim bOk As Boolean = Map.refSceneHostVM.SaveProject() + If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 70, 100) ' Saving data on Db + Dim MyMachGroupList As New List(Of MyMachGroupM) + If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then + For Each MachGroup In Map.refProjectVM.MachGroupPanelVM.m_MyMachGroupPanelM.MachGroupMList + MyMachGroupList.Add(MachGroup) + Next + End If + ' aggiorno pezzi su Db + If Not DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList) And bShowLoading Then + LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD) + Return False + End If + ' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj + If Map.refCALCPanelVM.IsMachineModified() Then + DbControllers.m_ProdController.UpdateMachine(Map.refOnlyProdManagerVM.CurrProd.nProdId, Map.refCALCPanelVM.SelectedMachine.Name) + Map.refOnlyProdManagerVM.CurrProd.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name) + ' ciclo sulla lista di ProjId associati + For Each ProjId In Map.refOnlyProdManagerVM.CurrProd.nProjIdList + ' aggiorno la Macchina per i ProjId associati sul DB + DbControllers.m_ProjController.UpdateMachine(ProjId, Map.refCALCPanelVM.SelectedMachine.Name) + ' se uno dei Proj interessati equivale al Proj correntemente aperto setto la Macchina dello stesso + ' (poichè il progetto corrente non viene riaperto e riletto dal DB) + If ProjId = Map.refProjManagerVM.CurrProj.nProjId Then Map.refProjManagerVM.CurrProj.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name) + Next + Map.refCALCPanelVM.ResetMachineModified() + End If + ' se nuovo progetto + If m_CurrProd.bIsNew Then + ' resetto stato new + ' DbControllers.m_ProdController.Reset(CurrProd.nProjId) + m_CurrProd.bIsNew = False + End If + Map.refMainWindowVM.UpdateTitle() + NotifyPropertyChanged(NameOf(MruFileNames)) + If bShowLoading Then LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD) + Return bOk + End Function + +#End Region ' SaveCommand + +#Region "ImportBTL" + + ''' + ''' Returns a command that do Export. + ''' + Public ReadOnly Property ImportBTL_Command As ICommand + Get + If m_cmdImportBTL Is Nothing Then + m_cmdImportBTL = New Command(AddressOf ImportBTL) + End If + Return m_cmdImportBTL + End Get + End Property + + ''' + ''' Execute the ImportBTL. This method is invoked by the ImportBTLCommand. + ''' + Public Sub ImportBTL(Optional sFile As String = "", Optional bWithDlg As Boolean = True) + If Not ProdFileVM.VerifyProjectModification(CurrProd) Then Return + Dim sDir As String = String.Empty + GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir) + If bWithDlg Then + ' apro finestra scelta file + Dim BTLDlg As New Microsoft.Win32.OpenFileDialog() With { + .DefaultExt = ".btl", + .Filter = "BTL (*.btl)|*.btl" & + "|BTLX (*.btlx)|*.btlx", + .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), + .CheckFileExists = True, + .ValidateNames = True} + If BTLDlg.ShowDialog() Then + sFile = BTLDlg.FileName + Else + Return + End If + End If + Dim nProjId As Integer = 0 + Dim sProjDir As String = "" + ' verifico se non e' tra i BTL gia' importati + Dim sBTLFileName As String = Path.GetFileNameWithoutExtension(sFile) + Dim nAlreadyImported As Integer = DbControllers.m_ProjController.AlreadyImported(sBTLFileName) + If nAlreadyImported > 0 Then + ' recupero progetto con lo stesso nome + Dim ToDeleteProj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(nAlreadyImported) + ' se esiste gia' un'ottimizzazione + If ToDeleteProj.nProdId > 0 Then + Select Case MessageBox.Show(EgtMsg(61942), "Information", MessageBoxButton.YesNo, MessageBoxImage.Information) ' BTL file already imported and optimized. Do you want to import it again? + Case MessageBoxResult.Yes + ' lo importo, quindi non devo fare nulla + Case MessageBoxResult.No + Return + End Select + Else + ' se non ha ottimizazione, chiedo se sovrascriverlo + Select Case MessageBox.Show(EgtMsg(61943), "Information", MessageBoxButton.YesNoCancel, MessageBoxImage.Information) ' BTL file already imported. Do you want to overwrite it? + Case MessageBoxResult.Yes + ' cancello BTLParts su DB + DbControllers.m_ProjController.UpdateBtlParts(nAlreadyImported, New List(Of BTLPartM)) + ' cancello nome BTL + DbControllers.m_ProjController.UpdateInfo(nAlreadyImported, DateTime.Now.ToString(), DateTime.Now.ToString(), "", DateTime.MinValue, BWType.NULL, "") + nProjId = nAlreadyImported + sProjDir = refMainWindowVM.MainWindowM.sProjsDir & "\" & nProjId.ToString("0000") + Case MessageBoxResult.No + ' lo importo, quindi non devo fare nulla + Case MessageBoxResult.Cancel + Return + End Select + End If + End If + ' se si ha una sola macchina disponibile (non BOTH) setto il progetto importato a quella macchina e al tipo progetto associato + ' altrimenti apro il dialog per scegliere la macchina e il tipo progetto a cui settare il progetto importato + Dim Machine As Machine = Nothing + Dim nType As BWType = BWType.NULL + Dim ProjectTypeWndVM As New ProjectTypeWndVM() + If ProjectTypeWndVM.MachineList.Count = 1 AndAlso DirectCast(ProjectTypeWndVM.SelMachine, MyMachine).nType <> MachineType.BOTH Then + Machine = ProjectTypeWndVM.SelMachine + nType = DirectCast(Machine, MyMachine).nType + Else + Dim ProjectTypeWnd As New ProjectTypeWndV(Application.Current.MainWindow, ProjectTypeWndVM) + If ProjectTypeWnd.ShowDialog() Then + Machine = ProjectTypeWndVM.SelMachine + nType = ProjectTypeWndVM.nSelType + Else + Return + End If + End If + LoadingWndHelper.OpenLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63008), EgtMsg(63009), 50) ' BTL file importing ' Reading BTL file + ' inizializzo nuovo progetto + InitNewProject(nProjId, sProjDir, nType, Machine) + SetCurrProj(nProjId) + ' imposto il tipo di parametri Q da utilizzare + BTLIniFile.m_nBTLBWType = nType + ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel + Map.refCALCPanelVM.LoadMachineList() + ' imposto ProjId di caricamento + m_nLoadingProjId = nProjId + ' copio file BTL + Dim sBtlCopyPath As String = sProjDir & "\" & Path.GetFileName(sFile) + Dim bOk = False + Try + File.Copy(sFile, sBtlCopyPath, True) + bOk = True + Catch ex As Exception + EgtOutLog("Impossibile copiare il file") + bOk = False + End Try + ' disattivo temporaneamente bottone assemblato per non prendere il riferimento sbagliato durante importazione + Dim bAssembly As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked + Map.refShowBeamPanelVM.ShowBuilding_IsChecked = False + ' importo file + If bOk Then + bOk = Map.refSceneHostVM.MainController.ImportProject(sBtlCopyPath, False) + End If + Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge" + Dim bFirstPart As Boolean = EgtGetFirstPart() <> GDB_ID.NULL + If bOk OrElse bFirstPart Then + ' salvo path di importazione + WriteMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, Path.GetDirectoryName(sFile)) + ' salvo il progetto + bOk = EgtSaveFile(sProjFileName, NGE.CMPTEXT) + SectionXMaterial.SetType(nType) + Core.ViewPanelVM.UpdateBWType(nType) + ' imposto flag secondo tipo di progetto (travi o pareti) + Dim sBTLFlag As String = If(nType = Core.ConstBeam.BWType.BEAM, K_BTLFLAG, K_WALLBTLFLAG) + Dim nFlag As Integer = GetMainPrivateProfileInt(S_IMPORT, sBTLFlag, EIB_FL.TS3_POS + EIB_FL.SORT + EIB_FL.USEUATTR) + EgtBeamSetFlag(nFlag) + Else + EgtOutLog("Errore nell'importazione BTL") + End If + If bOk Then + ' aggiorno Db + Dim ExportDate As DateTime + DateTime.TryParse(Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPDATE & " " & + Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPTIME, ExportDate) + DbControllers.m_ProjController.UpdateInfo(nProjId, sBTLFileName, sBTLFileName, Map.refProjectVM.BTLStructureVM.sLISTNAME, ExportDate, nType, Map.refMachinePanelVM.SelectedMachine.Name) + SetCurrProj(nProjId) + ' se progetto pareti e vista ruotata + If nType = BWType.WALL AndAlso (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) Then + ' ruoto le pareti di 180 per raddrizzarle rispetto alla vista + For Each Wall In Map.refProjectVM.BTLStructureVM.BTLPartVMList + Wall.Rotation(True, Map.refProjectVM.BTLStructureVM.nPROJTYPE, True, 180, False) + Next + End If + ' calcolo volumi pezzi + For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList + Part.CalcBTLPartVolume() + Next + Map.refProjectVM.SetOptimizePanel_Visibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO)) + Map.refPartManagerVM.LockVisibilityUpdate() + LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63006), 70, 100) ' Loading graphics + Map.refShowBeamPanelVM.ShowBuilding_IsChecked = bAssembly + ' mostro tutti i pezzi + Map.refShowBeamPanelVM.ShowAll(True) + Else + Map.refShowBeamPanelVM.ShowBuilding_IsChecked = bAssembly + ' elimino da Db + ' CheckMe impostata come cancellazione FISICA dal DB... + DbControllers.m_ProjController.DeleteProj(nProjId, False) + End If + ' carico filtri di ricerca + Map.refProjectVM.BTLStructureVM.LoadFilters() + ' gestisco log di importazione + ManageImportLog(nProjId, sProjDir) + ' aggiorno titolo + Map.refMainWindowVM.UpdateTitle() + LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTBTL) + End Sub + + Private Sub ManageImportLog(nProjId As Integer, sProjDir As String) + Dim LogFile As New List(Of String) + Using FileStream As FileStream = New FileStream(Map.refMainWindowVM.MainWindowM.sLogFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) + Dim StreamReader As New StreamReader(FileStream) + Dim Line As String = StreamReader.ReadLine() + While Not StreamReader.EndOfStream + Line = StreamReader.ReadLine() + LogFile.Add(Line) + End While + StreamReader.Close() + End Using + If LogFile.Count > 0 Then + ' recupero ultima occorrenza di import + Dim sLastImport As String = LogFile.LastOrDefault(Function(x) x.Contains("ImportBtl")) + ' verifico linee successive + Dim nLastImportIndex As Integer = -1 + If Not String.IsNullOrWhiteSpace(sLastImport) Then + nLastImportIndex = LogFile.IndexOf(sLastImport) + End If + Dim sImportMessage As String = sLastImport & Environment.NewLine + Dim sImportLog As New List(Of String)({sLastImport}) + If nLastImportIndex > 0 Then + Dim bGlobalError As Boolean = False + ' ciclo sulle righe successive + For Index = nLastImportIndex + 1 To LogFile.Count - 1 + Dim sLogLine As String = LogFile(Index).Trim() + ' verifico se fanno parte dell'import + Dim bStartWithError As Boolean = sLogLine.StartsWith("Error") + Dim bStartWithInfo As Boolean = sLogLine.StartsWith("Info") + If Not bStartWithError And Not bStartWithInfo Then Exit For + If bStartWithError Then + If Not bGlobalError Then bGlobalError = True + sImportMessage &= sLogLine & Environment.NewLine + End If + sImportLog.Add(sLogLine) + Next + ' salvo file ImportLog nel progetto + Try + File.WriteAllLines(sProjDir & "\" & nProjId.ToString("0000") & "-ImportLog.txt", sImportLog) + Catch ex As Exception + ' + End Try + ' se almeno un errore, mostro log + If bGlobalError Then + MessageBox.Show(Application.Current.MainWindow, sImportMessage, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error + End If + End If + End If + End Sub + +#End Region ' ImportBTL + +#Region "UpdateBTL" + + ''' + ''' Returns a command that do UpdateBTL. + ''' + Public ReadOnly Property UpdateBTL_Command As ICommand + Get + If m_cmdUpdateBTL Is Nothing Then + m_cmdUpdateBTL = New Command(AddressOf UpdateBTL) + End If + Return m_cmdUpdateBTL + End Get + End Property + + ''' + ''' Execute the UpdateBTL. This method is invoked by the UpdateBTLCommand. + ''' + Public Sub UpdateBTL(Optional sFile As String = "", Optional bWithDlg As Boolean = True) + If IsNothing(CurrProj) Then Return + ' verifico se progetto modificato, e chiedo se salvare + If CurrProj.bIsNew Or EgtGetModified() OrElse Map.refCALCPanelVM.IsMachineModified() Then + Select Case MessageBox.Show(EgtMsg(61877), "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) + Case MessageBoxResult.Yes + Save() + Case MessageBoxResult.Cancel + Return + Case Else ' No + MessageBox.Show(EgtMsg(61892), "", MessageBoxButton.OK, MessageBoxImage.Exclamation) + Return + End Select + End If + + ' se vista tutti i pezzi + Dim bShowBuilding As Boolean = False + Dim bShowSolid As Boolean = False + Dim nSelPartId As Integer = GDB_ID.NULL + If Map.refShowBeamPanelVM.bShowAll Then + ' verifico se assemblato e lo annullo per salvataggio + bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked + If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) + ' se vista singolo pezzo + Else + bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked + If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False) + ' se pezzo selezionato lo segno e metto vista tutti + nSelPartId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId + Map.refProjectVM.BTLStructureVM.ShowAll(False) + End If + + Dim sDir As String = String.Empty + GetMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, "", sDir) + If bWithDlg Then + ' apro finestra scelta file + Dim BTLDlg As New Microsoft.Win32.OpenFileDialog() With { + .DefaultExt = ".btl", + .Filter = "BTL (*.btl)|*.btl" & + "|BTLX (*.btlx)|*.btlx", + .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), + .CheckFileExists = True, + .ValidateNames = True} + If BTLDlg.ShowDialog() Then + sFile = BTLDlg.FileName + Else + ' se assemblato lo ripristino + If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False) + If nSelPartId <> GDB_ID.NULL Then + Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId) + If Not IsNothing(SelPart) Then + SelPart.IsSelected = True + If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False) + End If + End If + EgtZoom(ZM.ALL) + Return + End If + End If + ' salvo lista pezzi del progetto originale + Dim OrigPartlist As ObservableCollection(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.BTLPartVMList + ' creo un nuovo contesto su cui aprire il file BTL + Dim nCurrCtx As Integer = EgtGetCurrentContext() + Dim nTempCtx As Integer = EgtInitContext() + + ' setto il flag per inizializzazione gestore travi e pareti per importare progetto + Dim nFlag As Integer + Dim sBTLFlag As String + If Map.refProjManagerVM.nProjType = Core.ConstBeam.BWType.BEAM Then + sBTLFlag = K_BTLFLAG + Else + sBTLFlag = K_WALLBTLFLAG + End If + nFlag = GetMainPrivateProfileInt(S_IMPORT, sBTLFlag, EIB_FL.TS3_POS + EIB_FL.SORT + EIB_FL.USEUATTR) + + ' inizializzo gestore travi e pareti + EgtInitBeamMgr(nFlag) + + Dim bOk As Boolean = nTempCtx <> 0 + If bOk Then + ' importo il file BTL + bOk = bOk AndAlso Map.refSceneHostVM.MainController.ImportProject(sFile, False) + ' carico la lista dei Part importati e rimuovo i parametri generali del BTL + Dim AsseBaseId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) + Dim BtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) + Dim PartToUpdateList As New List(Of BTLPartToUpdate) + + ' cerco tra i layer BTLInfo + While BtlInfoId <> GDB_ID.NULL + ' verifico se il layer appartiene al ProjId + Dim nBTLInfoLayerProjId As Integer + EgtGetInfo(BtlInfoId, BTL_PRT_PROJ, nBTLInfoLayerProjId) + ' carico la lista con i PDN dei pezzi del BTL importato + Dim nPDN As Integer = 0 + Dim sNAM As String = String.Empty + Dim nUID As Integer = 0 + Dim nPartId As Integer = EgtGetFirstPart() + While nPartId <> GDB_ID.NULL + Dim UIDList As New List(Of Integer) + Dim nIndUID As Integer = 1 + ' se devo filtrare un progetto + If nBTLInfoLayerProjId > 0 Then + ' verifico se il pezzo appartiene al ProjId + Dim nPartProjId As Integer + EgtGetInfo(nPartId, BTL_PRT_PROJ, nPartProjId) + If nPartProjId = nBTLInfoLayerProjId Then + EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN) + EgtGetInfo(nPartId, BTL_PRT_NAM, sNAM) + While EgtGetInfo(nPartId, BTL_PRT_UID & nIndUID, nUID) + UIDList.Add(nUID) + nIndUID += 1 + End While + PartToUpdateList.Add(New BTLPartToUpdate(nPartId, nPDN, sNAM, UIDList, OrigPartlist.Any(Function(x) x.nPDN = nPDN))) + End If + Else + ' altrimenti carico tutti + EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN) + EgtGetInfo(nPartId, BTL_PRT_NAM, sNAM) + While EgtGetInfo(nPartId, BTL_PRT_UID & nUID, nUID) + UIDList.Add(nUID) + nIndUID += 1 + End While + PartToUpdateList.Add(New BTLPartToUpdate(nPartId, nPDN, sNAM, UIDList, OrigPartlist.Any(Function(x) x.nPDN = nPDN))) + End If + nPartId = EgtGetNextPart(nPartId) + End While + EgtErase(BtlInfoId) + BtlInfoId = EgtGetNextName(BtlInfoId, BTLINFO) + End While + + ' costruisco un dizionario con gli id dei sottonodi di AsseBase del BTL importato e il valore dell'Info N degli stessi + Dim AsseBaseSubNodeDict As New Dictionary(Of Integer, Integer) + Dim nAsseBaseSubNodeId As Integer = EgtGetFirstInGroup(AsseBaseId) + Dim sAsseBaseUID As String = String.Empty + Dim nAsseBaseUID As Integer = 0 + While nAsseBaseSubNodeId <> GDB_ID.NULL + If EgtGetInfo(nAsseBaseSubNodeId, BTL_ASSEBASE_N, sAsseBaseUID) Then + sAsseBaseUID = sAsseBaseUID.Remove(0, 4) + Integer.TryParse(sAsseBaseUID, nAsseBaseUID) + AsseBaseSubNodeDict.Add(nAsseBaseSubNodeId, sAsseBaseUID) + End If + nAsseBaseSubNodeId = EgtGetNext(nAsseBaseSubNodeId) + End While + + ' salvo il file BTL da cui abbiamo rimosso BtlInfo come file NGE + EgtSaveFile(Map.refMainWindowVM.MainWindowM.sTempDir & "\" & UPDATEBTL_NGE, NGE.CMPTEXT) + + Dim bAppend As Boolean = False + ' se UserLevel > 5 e fra i Part importati ce ne sta almeno 1 con PDN uguale ai Part già presenti + ' apro la finestra per chiedere se si vuole aggiornare o accodare + If Map.refMainWindowVM.MainWindowM.nUserLevel > 5 Then + For Each PartToUpdate In PartToUpdateList + Dim bExitFor As Boolean = False + For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLStructureM.BTLPartMList + If PartToUpdate.nPDN = BTLPart.nPDN Then + Dim UpdateOrAppendWndVM As New UpdateOrAppendWndVM() + Dim UpdateOrAppendWnd As New UpdateOrAppendWndV(Application.Current.MainWindow, UpdateOrAppendWndVM) + If Not UpdateOrAppendWnd.ShowDialog() Then + ' torno sul contesto corrente + EgtSetCurrentContext(nCurrCtx) + EgtDeleteContext(nTempCtx) + ' rileggo la struttura BTL + ReloadBTLStructure() + ' se assemblato lo ripristino + If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False) + If nSelPartId <> GDB_ID.NULL Then + Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId) + If Not IsNothing(SelPart) Then + SelPart.IsSelected = True + If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False) + End If + End If + EgtZoom(ZM.ALL) + Return + End If + ' salvo lo stato del bottone per accodare + bAppend = UpdateOrAppendWndVM.AppendIsChecked + bExitFor = True + Exit For + End If + Next + If bExitFor Then Exit For + Next + End If + + ' se selezionato Append li accodo tutti + If bAppend Then + ' torno sul contesto corrente + EgtSetCurrentContext(nCurrCtx) + EgtDeleteContext(nTempCtx) + + ' rileggo la struttura BTL del progetto corrente per non avere quella del contesto temporaneo ancora presente + ReloadBTLStructure() + + ' salvo gli id degli AsseBase presenti nel progetto corrente + Dim AsseBaseIdList As New List(Of Integer) + AsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) + While AsseBaseId <> GDB_ID.NULL + AsseBaseIdList.Add(AsseBaseId) + AsseBaseId = EgtGetNextName(AsseBaseId, ASSEBASE) + End While + + ' calcolo BBox globale del progetto iniziale + Dim b3Parts As New BBox3d + Dim nProjPartId As Integer = EgtGetFirstPart() + Dim nLastProjPartId As Integer = 0 + While nProjPartId <> GDB_ID.NULL + Dim b3Part As New BBox3d + EgtGetBBoxGlob(nProjPartId, GDB_BB.ONLY_VISIBLE, b3Part) + b3Parts.Add(b3Part) + nLastProjPartId = nProjPartId + nProjPartId = EgtGetNextPart(nProjPartId) + End While + ' inserisco il file importato nel progetto corrente + bOk = bOk AndAlso EgtInsertFile(Map.refMainWindowVM.MainWindowM.sTempDir & "\" & UPDATEBTL_NGE) + ' deseleziono tutto + EgtDeselectAll() + ' ciclo sui pezzi aggiunti + Dim nAddedPartId As Integer = EgtGetNextPart(nLastProjPartId) + Dim bFirstLoop As Boolean = True + Dim LastPartMaxY As Double + Dim nIncrPDN As Integer = 0 + While nAddedPartId <> GDB_ID.NULL + ' incremento il PDN del Part aggiunto rispetto al PDN maggiore attualmente presente + EgtSetInfo(nAddedPartId, BTL_PRT_PDN, Map.refProjectVM.BTLStructureVM.BTLStructureM.NewPDN() + nIncrPDN) + ' recupero layer del box + Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nAddedPartId, "Box") + ' recupero box del layer box + Dim b3Box As New BBox3d + EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) + ' ricaviamo il box globale del part appena aggiunto + Dim b3Part As New BBox3d + EgtGetBBoxGlob(nAddedPartId, 1, b3Part) + ' sposto il pezzo per distanziarlo dall'ultimo di un offset pari a 500 + bOk = bOk AndAlso EgtMove(nAddedPartId, New Vector3d(0, If(bFirstLoop, b3Parts.Max.y, LastPartMaxY - b3Part.Min.y) + 500, 0)) + bFirstLoop = False + ' ricaviamo il box globale del part appena spostato, salviamo la sua Y massima e lo aggiungiamo al box globale di tutti i part + EgtGetBBoxGlob(nAddedPartId, 1, b3Part) + LastPartMaxY = b3Part.Max.y + b3Parts.Add(b3Part) + nAddedPartId = EgtGetNextPart(nAddedPartId) + nIncrPDN += 1 + End While + ' aggiungo i part inseriti alla lista + Dim nNewPartId As Integer = EgtGetNextPart(nLastProjPartId) + While nNewPartId <> GDB_ID.NULL + ' aggiungo dati pezzo + Dim NewPart As BTLPartM = BTLPartM.CreateBTLPart(nNewPartId) + ' aggiungo pezzo alla lista + Map.refProjectVM.BTLStructureVM.BTLStructureM.AddBTLPart(NewPart) + Dim AddedBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart) + ' verifico se aggiungere sezione alla lista + If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(AddedBTLPart.Section) Then + Map.refProjectVM.BTLStructureVM.SectionList.Add(AddedBTLPart.Section) + End If + nNewPartId = EgtGetNextPart(nNewPartId) + End While + + ' elimino gli AsseBase del progetto importato + AsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) + While AsseBaseId <> GDB_ID.NULL + Dim CurrAsseBaseId = AsseBaseId + AsseBaseId = EgtGetNextName(AsseBaseId, ASSEBASE) + If Not AsseBaseIdList.Contains(CurrAsseBaseId) Then EgtErase(CurrAsseBaseId) + End While + + WriteMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, Path.GetDirectoryName(sFile)) + Else + ' altrimenti apro la finestra con l'elenco dei Part da checkare per l'inserimento nel progetto (unica strada se UserLevel <= 5), + ' che prevederà la sovrascrittura di quelli già presenti e l'aggiunta di quelli nuovi + Dim UpdateBTLWndVM As New UpdateBTLWndVM(PartToUpdateList) + Dim UpdateBTLWnd As New UpdateBTLWndV(Application.Current.MainWindow, UpdateBTLWndVM) + If Not UpdateBTLWnd.ShowDialog() Then + ' torno sul contesto corrente + EgtSetCurrentContext(nCurrCtx) + EgtDeleteContext(nTempCtx) + ' rileggo la struttura BTL + ReloadBTLStructure() + ' se assemblato lo ripristino + If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False) + If nSelPartId <> GDB_ID.NULL Then + Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId) + If Not IsNothing(SelPart) Then + SelPart.IsSelected = True + If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False) + End If + End If + EgtZoom(ZM.ALL) + Return + End If + If UpdateBTLWndVM.BTLPartList.Count > 0 Then + ' sovrascrivo i Part nel progetto aperto con i Part checkati nella lista + Dim BTLPartToOverwriteWithList As New ObservableCollection(Of BTLPartToUpdate) + ' Elimino dal TempCtx i Part non checkati + For Each BTLPartToOverwriteWith In UpdateBTLWndVM.BTLPartList + If BTLPartToOverwriteWith.bInsert Then + BTLPartToOverwriteWithList.Add(BTLPartToOverwriteWith) + Else + ' elimino pezzo copia + Dim nCurrPartId = EgtGetCurrPart() + EgtErase(BTLPartToOverwriteWith.nPartId) + nCurrPartId = EgtGetCurrPart() + End If + Next + + ' costruisco un nuovo dizionario dei sottonodi di AsseBase contenente solo quelli corrispondenti agli UID contenuti + ' nei soli Part checkati del BTL nella finestra UpdateBTLWnd + Dim NewAsseBaseSubNodeDict As New Dictionary(Of Integer, Integer) + For Each AsseBaseSubNodeItem In AsseBaseSubNodeDict + For Each BTLPartToOverwriteWithItem In BTLPartToOverwriteWithList + Dim bExitFor As Boolean = False + For Each UIDItem In BTLPartToOverwriteWithItem.UIDList + If AsseBaseSubNodeItem.Value = UIDItem Then + NewAsseBaseSubNodeDict.Add(AsseBaseSubNodeItem.Key, AsseBaseSubNodeItem.Value) + bExitFor = True + Exit For + End If + Next + If bExitFor Then Exit For + Next + Next + ' confronto la lista appena costruita con quella originale ed elimino dal contesto i sottonodi con i valori non più presenti + For Each AsseBaseSubNodeItem In AsseBaseSubNodeDict + If Not NewAsseBaseSubNodeDict.ContainsValue(AsseBaseSubNodeItem.Value) Then + EgtErase(AsseBaseSubNodeItem.Key) + End If + Next + + ' salvo il file NGE inserito a cui abbiamo rimosso i Part non checkati e gli AsseBase non più associati + EgtSaveFile(Map.refMainWindowVM.MainWindowM.sTempDir & "\" & UPDATEBTL_NGE, NGE.CMPTEXT) + + ' torno sul contesto corrente + EgtDeleteContext(nTempCtx) + EgtSetCurrentContext(nCurrCtx) + + ' rileggo la struttura BTL del progetto corrente per non avere quella del contesto temporaneo ancora presente + ReloadBTLStructure() + + ' elimino i pezzi da sovrascrivere nel progetto corrente + For Each BTLPartToOverwriteWith In UpdateBTLWndVM.BTLPartList + If BTLPartToOverwriteWith.bInsert Then + Dim BTLPartToUpdate As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPDN = BTLPartToOverwriteWith.nPDN) + ' se BTLPartToUpdate è Nothing significa che il pezzo è nuovo e quindi basta accodarlo senza eliminare nulla + If Not IsNothing(BTLPartToUpdate) Then + Dim nPartToDeleteId As Integer = BTLPartToUpdate.nPartId + Dim nCurrPartId = EgtGetCurrPart() + EgtErase(nPartToDeleteId) + nCurrPartId = EgtGetCurrPart() + ' verifico se rimuovere sezione dalla lista + If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToUpdate AndAlso x.Section = BTLPartToUpdate.Section) Then + Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToUpdate.Section) + End If + ' rimuovo dalla lista pezzi + Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToUpdate) + Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing) + Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index) + End If + End If + Next + + ' salvo gli id degli AsseBase presenti nel progetto corrente + Dim AsseBaseIdList As New List(Of Integer) + AsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) + While AsseBaseId <> GDB_ID.NULL + AsseBaseIdList.Add(AsseBaseId) + ' elimino i sottonodi di AsseBase da sovrascrivere + AsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) + nAsseBaseSubNodeId = EgtGetFirstInGroup(AsseBaseId) + While nAsseBaseSubNodeId <> GDB_ID.NULL + If NewAsseBaseSubNodeDict.ContainsKey(nAsseBaseSubNodeId) Then + ' se sottonodo da cancellare salvo il suo id e ricavo il seguente prima di cancellarlo + Dim nCurrAsseBaseSubNodeId = nAsseBaseSubNodeId + nAsseBaseSubNodeId = EgtGetNext(nCurrAsseBaseSubNodeId) + bOk = EgtErase(nCurrAsseBaseSubNodeId) + Else + ' altrimenti ricavo il seguente e basta + nAsseBaseSubNodeId = EgtGetNext(nAsseBaseSubNodeId) + End If + End While + AsseBaseId = EgtGetNextName(AsseBaseId, ASSEBASE) + End While + + ' calcolo BBox globale del progetto corrente + Dim b3Parts As New BBox3d + Dim nProjPartId As Integer = EgtGetFirstPart() + Dim nLastProjPartId As Integer = GDB_ID.NULL + While nProjPartId <> GDB_ID.NULL + Dim b3Part As New BBox3d + If EgtGetBBoxGlob(nProjPartId, GDB_BB.ONLY_VISIBLE, b3Part) Then + b3Parts.Add(b3Part) + End If + nLastProjPartId = nProjPartId + nProjPartId = EgtGetNextPart(nProjPartId) + End While + ' se sovrascrivo tutti e bbox esce nullo + If b3Parts.IsEmpty Then + b3Parts = New BBox3d(Point3d.ORIG) + End If + + ' inserisco il file NGE (ricavato dal BTL importato) nel progetto corrente + bOk = bOk AndAlso EgtInsertFile(Map.refMainWindowVM.MainWindowM.sTempDir & "\" & UPDATEBTL_NGE) + + ' ciclo su tutti gli AsseBase del progetto corrente + Dim nAsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) + While nAsseBaseId <> GDB_ID.NULL + Dim nAsseBaseProjId As Integer + Dim nAsseBaseToEraseId As Integer = 0 + EgtGetInfo(nAsseBaseId, BTL_PRT_PROJ, nAsseBaseProjId) + ' se AsseBase di questo step del ciclo è nuovo e suo ProjId uguale a quello del progetto corrente + If Not AsseBaseIdList.Contains(nAsseBaseId) AndAlso nAsseBaseProjId = Map.refProjManagerVM.CurrProj.nProjId Then + ' riloco i sottonodi del nuovo AsseBase nell'AsseBase del progetto aperto col medesimo ProjId + Dim AsseBaseSubNodeId As Integer = EgtGetFirstInGroup(nAsseBaseId) + While AsseBaseSubNodeId <> GDB_ID.NULL + ' ciclo su tutti gli AsseBase per trovare l'id di quello con ProjId uguale al progetto corrente + Dim FindAsseBaseId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) + While FindAsseBaseId <> GDB_ID.NULL + Dim SameAsseBaseProjId As Integer + EgtGetInfo(FindAsseBaseId, BTL_PRT_PROJ, SameAsseBaseProjId) + ' se l'ho trovato esco dal While (FindAsseBaseId è l'id dell'AsseBase in cui vogliamo rilocare i sottonodi) + If SameAsseBaseProjId = Map.refProjManagerVM.CurrProj.nProjId Then Exit While + FindAsseBaseId = EgtGetNextName(FindAsseBaseId, ASSEBASE) + End While + ' salvo id dell'AsseBase corrente per ottenere il seguente prima di rilocarlo + Dim CurrAsseBaseSubNodeId = AsseBaseSubNodeId + AsseBaseSubNodeId = EgtGetNext(CurrAsseBaseSubNodeId) + bOk = bOk AndAlso EgtRelocate(CurrAsseBaseSubNodeId, FindAsseBaseId, GDB_POS.LAST_SON) + End While + ' salvo id dell'AsseBase per cancellarlo + nAsseBaseToEraseId = nAsseBaseId + End If + ' ricavo id del prossimo AsseBase + nAsseBaseId = EgtGetNextName(nAsseBaseId, ASSEBASE) + ' se salvato id dell'AsseBase per cancellarlo lo cancello + If nAsseBaseToEraseId <> 0 Then bOk = bOk AndAlso EgtErase(nAsseBaseToEraseId) + End While + + ' deseleziono tutto + EgtDeselectAll() + ' ciclo sui pezzi aggiunti + Dim nAddedPartId As Integer = If(nLastProjPartId <> GDB_ID.NULL, EgtGetNextPart(nLastProjPartId), EgtGetFirstPart()) + Dim LastPartMaxY As Double + While nAddedPartId <> GDB_ID.NULL + ' recupero layer del box + Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nAddedPartId, "Box") + ' recupero box del layer box + Dim b3Box As New BBox3d + EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) + ' ricaviamo il box globale del part appena aggiunto e ruotato + Dim b3Part As New BBox3d + EgtGetBBoxGlob(nAddedPartId, 1, b3Part) + ' salviamo la Y massima del box globale di tutti i part + LastPartMaxY = b3Parts.Max.y + ' sposto il pezzo per distanziarlo dall'ultimo di un offset pari a 500 + bOk = bOk AndAlso EgtMove(nAddedPartId, New Vector3d(0, LastPartMaxY - b3Part.Min.y + 500, 0)) + ' ricaviamo il box globale del part appena spostato e lo aggiungiamo al box globale di tutti i part + EgtGetBBoxGlob(nAddedPartId, 1, b3Part) + b3Parts.Add(b3Part) + ' aggiungo dati pezzo + Dim NewPart As BTLPartM = BTLPartM.CreateBTLPart(nAddedPartId) + ' aggiungo pezzo alla lista + Map.refProjectVM.BTLStructureVM.BTLStructureM.AddBTLPart(NewPart) + Dim AddedBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart) + ' se progetto pareti e vista ruotata + If nType = BWType.WALL AndAlso (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) Then + ' ruoto le pareti di 180 per raddrizzarle rispetto alla vista + AddedBTLPart.Rotation(True, Map.refProjectVM.BTLStructureVM.nPROJTYPE, True, 180, False) + End If + ' verifico se aggiungere sezione alla lista + If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(AddedBTLPart.Section) Then + Map.refProjectVM.BTLStructureVM.SectionList.Add(AddedBTLPart.Section) + End If + nAddedPartId = EgtGetNextPart(nAddedPartId) + End While + WriteMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, Path.GetDirectoryName(sFile)) + End If + End If + ' copio il file originale scelto nel dialog per l'Update nella cartella Proj del progetto corrente + If File.Exists(sFile) Then + Dim sDestPath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Path.GetFileNameWithoutExtension(sFile) + While File.Exists(sDestPath & ".btl") + sDestPath = sDestPath & "_1" + End While + File.Copy(sFile, sDestPath & ".btl", False) + End If + End If + ' se assemblato lo ripristino + If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False) + If nSelPartId <> GDB_ID.NULL Then + Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId) + If Not IsNothing(SelPart) Then + SelPart.IsSelected = True + If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False) + End If + End If + EgtZoom(ZM.ALL) + End Sub + +#End Region ' UpdateBTL + +#Region "ExportProject" + + ''' + ''' Returns a command that do Export. + ''' + Public ReadOnly Property ExportProject_Command As ICommand + Get + If m_cmdExportProject Is Nothing Then + m_cmdExportProject = New Command(AddressOf ExportProject) + End If + Return m_cmdExportProject + End Get + End Property + + ''' + ''' Execute the Export. This method is invoked by the ExportCommand. + ''' + Public Function ExportProject(Optional sExportFileName As String = Nothing) As String + Select Case Map.refMainMenuVM.SelPage + Case Pages.VIEW + If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return Nothing + If IsNothing(CurrProj) Then Return Nothing + Case Pages.MACHINING + If ProdFileVM.VerifyProjectModification(Map.refProdManagerVM.CurrProd) = MessageBoxResult.Cancel Then Return Nothing + If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Nothing + Case Else + Return Nothing + End Select + + ' apro finestra di salvataggio progetto + Dim ExportDlg As New Microsoft.Win32.SaveFileDialog() With {.DefaultExt = ".ngexp", + .Filter = "ProjectExport (*.ngexp)|*.ngexp", + .FileName = CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - ProjectExport"} + If IsNothing(sExportFileName) Then + If ExportDlg.ShowDialog() <> True Then Return Nothing + End If + + LoadingWndHelper.OpenLoadingWnd(ActiveIds.EXPORTPROJECT, 2, EgtMsg(63010), EgtMsg(63016), 30) ' Project exporting ' Adding export info + ' se assemblato me lo segno e lo smonto + Dim bShowBuilding As Boolean = False + If Map.refMainMenuVM.SelPage = Pages.VIEW Then + If Map.refShowBeamPanelVM.bShowAll Then + ' verifico se assemblato e lo annullo per salvataggio + bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked + If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) + End If + End If + + ' per ogni BTLInfo nel progetto riporto il relativo nome del BTL + Dim nBTLInfoProjId As Integer + Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) + While nBTLInfoLayerId <> GDB_ID.NULL + ' recupero il ProjId + EgtGetInfo(nBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoProjId) + If nBTLInfoProjId > 0 Then + ' recupero il BTL file name di questo proj + Dim BTLFileNameProj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(nBTLInfoProjId) + If Not IsNothing(BTLFileNameProj) Then + EgtSetInfo(nBTLInfoLayerId, BTLFILENAME, BTLFileNameProj.sBTLFileName) + End If + End If + nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO) + End While + ' aggiungo layer per info di export + Dim nImpExpPartId As Integer = EgtCreateGroup(GDB_ID.ROOT) + EgtSetName(nImpExpPartId, EXP_PART) + ' ci scrivo nome macchina e tipo progetto + EgtSetInfo(nImpExpPartId, EXP_MACHINE, CurrProj.sMachine) + EgtSetInfo(nImpExpPartId, BTL_GEN_PROJTYPE, CurrProj.nType) + + LoadingWndHelper.UpdateLoadingWnd(ActiveIds.EXPORTPROJECT, 2, EgtMsg(63017), 30, 100) ' Exporting... + ' salvo info inserite + Map.refSceneHostVM.SaveProject() + ' creo file zip + Dim sZipToCreate As String = If(IsNothing(sExportFileName), ExportDlg.FileName, Map.refMainWindowVM.MainWindowM.sTempDir & "\" & sExportFileName & ".ngexp") + If File.Exists(sZipToCreate) Then + File.Delete(sZipToCreate) + End If + Try + Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out) + ' impacchetto tutta la cartella del progetto + Dim sProjectDirPath As String = If(CurrProj.nProdId > 0, CurrProj.sProdDirPath, CurrProj.sProjDirPath) + For Each sFile As String In Directory.GetFiles(sProjectDirPath) + zip.AddItem(sFile, "") + Next + ' salvo lo zip + zip.Save() + End Using + Catch ex1 As Exception + EgtOutLog("Exception in zip: " & ex1.ToString()) + MessageBox.Show("Error in export file creation!") + End Try + ' elimino layer di esportazione + EgtErase(nImpExpPartId) + ' salvo eliminazione info inserite + Map.refSceneHostVM.SaveProject() + If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False) + LoadingWndHelper.CloseLoadingWnd(ActiveIds.EXPORTPROJECT) + Return sZipToCreate + End Function + +#End Region ' ExportProject + +#Region "ImportProject" + + ''' + ''' Returns a command that do Export. + ''' + Public ReadOnly Property ImportProject_Command As ICommand + Get + If m_cmdImportProject Is Nothing Then + m_cmdImportProject = New Command(AddressOf ImportProject) + End If + Return m_cmdImportProject + End Get + End Property + + ''' + ''' Execute the Export. This method is invoked by the ExportCommand. + ''' + Public Sub ImportProject() + Dim CurrProd As ProjectFileVM = Map.refProdManagerVM.CurrProd + ' lista di tutti gli errori riscontrati + Dim ErrorList As New List(Of String) + If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return + Dim sDir As String = String.Empty + GetMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, "", sDir) + ' apro finestra scelta file + Dim ImportDlg As New Microsoft.Win32.OpenFileDialog() With {.DefaultExt = ".ngexp", + .Filter = "ProjectExport (*.ngexp)|*.ngexp", + .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), + .CheckFileExists = True, + .ValidateNames = True} + If ImportDlg.ShowDialog() <> True Then Return + ' creo cartella temporanea di estrazione in Temp + Dim sProjectimportDir As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\ProjectImport" + If Directory.Exists(sProjectimportDir) Then + Directory.Delete(sProjectimportDir, True) + End If + Directory.CreateDirectory(sProjectimportDir) + Try + Using zip As New Ionic.Zip.ZipFile(ImportDlg.FileName, Console.Out) + ' estraggo file da zip + zip.ExtractAll(sProjectimportDir) + End Using + Catch ex1 As Exception + EgtOutLog("Exception in zip: " & ex1.ToString()) + MessageBox.Show("Impossibile importare file", "Errore") + Return + End Try + LoadingWndHelper.OpenLoadingWnd(ActiveIds.IMPORTPROJECT, 2, EgtMsg(63018), EgtMsg(63019), 30) ' Project importing ' Loading project + ' carico progetto + Dim sProjFromPath() As String = Directory.GetFiles(sProjectimportDir, "*.nge") + Dim bOk = EgtOpenFile(sProjFromPath(0)) + If Not bOk Then + LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT) + MessageBox.Show("Impossibile aprire il file", "Errore") + Return + End If + ' recupero e verifico se ho a disposizione la macchina con cui e' stato creato il progetto + Dim nImpExpPartId = EgtGetFirstNameInGroup(GDB_ID.ROOT, EXP_PART) + Dim sMachine As String = "" + EgtGetInfo(nImpExpPartId, EXP_MACHINE, sMachine) + ' se la macchina del progetto in apertura non è tra le macchine disponibili lo segnalo e apro un progetto vuoto + If IsNothing(Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = sMachine)) Then + LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT) + MessageBox.Show(EgtMsg(61885), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + Return + End If + Dim Machine As Machine = Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = sMachine) + Dim nType As Integer = BWType.NULL + EgtGetInfo(nImpExpPartId, BTL_GEN_PROJTYPE, nType) + If IsNothing(Machine) OrElse nType = BWType.NULL Then + LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT) + MessageBox.Show(EgtMsg(61885), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + Return + End If + ' elimino part di esportazione + EgtErase(nImpExpPartId) + LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTPROJECT, 2, EgtMsg(63020), 30, 100) ' Creating imported project + ' leggo proj e prod presenti dai layer BTLInfo + Dim ImportProjIdList As New List(Of Integer) + Dim NewProjIdList As New List(Of Integer) + Dim BTLInfoIdList As New List(Of Integer) + Dim BTLFileNameList As New List(Of String) + Dim CurrImportProjId As Integer + Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) + While nBTLInfoLayerId <> GDB_ID.NULL + ' recupero il ProjId + EgtGetInfo(nBTLInfoLayerId, BTL_PRT_PROJ, CurrImportProjId) + If CurrImportProjId > 0 Then + ImportProjIdList.Add(CurrImportProjId) + BTLInfoIdList.Add(nBTLInfoLayerId) + ' recupero nome file BTL Associato + Dim sBTLFileName As String = "" + EgtGetInfo(nBTLInfoLayerId, BTLFILENAME, sBTLFileName) + BTLFileNameList.Add(sBTLFileName) + End If + nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO) + End While + If Not ImportProjIdList.Count > 0 Then + MessageBox.Show("Nessun progetto trovato all'interno del file importato", "Errore") + End If + ' carico i proj + For nProjIndex = 0 To ImportProjIdList.Count - 1 + Dim nImportProjId As Integer = ImportProjIdList(nProjIndex) + ' inizializzo nuovo proj + Dim nNewProjId As Integer = 0 + Dim sNewProjDir As String = "" + InitNewProject(nNewProjId, sNewProjDir, nType, Machine) + NewProjIdList.Add(nNewProjId) + ' imposto ProjId di caricamento + m_nLoadingProjId = nImportProjId + ' costruisco BTLStructure del proj + Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(nImportProjId)) + ' scrivo info proj su tutti i pezzi di questo progetto + For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList + EgtSetInfo(BTLPart.nPartId, BTL_PRT_PROJ, nNewProjId) + Next + ' cambio indicazione proj in gruppo di assemblaggio + Dim AsseBaseId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) + While AsseBaseId <> GDB_ID.NULL + Dim nAsseBaseProj As Integer = 0 + EgtGetInfo(AsseBaseId, BTL_PRT_PROJ, nAsseBaseProj) + If nAsseBaseProj = nImportProjId Then + EgtSetInfo(AsseBaseId, BTL_PRT_PROJ, NewProjIdList(nProjIndex)) + Exit While + End If + AsseBaseId = EgtGetNextName(AsseBaseId, ASSEBASE) + End While + ' riporto nuovo ProjId nel layer BTLInfo + EgtSetInfo(BTLInfoIdList(nProjIndex), BTL_PRT_PROJ, nNewProjId) + ' resetto tutti gli stati di CALC + For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList + BTLPart.ResetCalcTotalPart() + Next + ' salvo modifiche fatte al progetto + bOk = bOk AndAlso Map.refSceneHostVM.MainController.SaveProject() + If bOk Then + ' copio file BTL e progetto + Dim sBTLFromPath As String = sProjectimportDir & "\" & BTLFileNameList(nProjIndex) & ".btl" + Dim sProjFileName As String = sNewProjDir & "\" & nNewProjId.ToString("0000") & ".nge" + If sProjFromPath.Count > 0 AndAlso Not String.IsNullOrWhiteSpace(sProjFromPath(0)) Then + Try + If Not String.IsNullOrWhiteSpace(sBTLFromPath) AndAlso File.Exists(sBTLFromPath) Then + Dim sBtlToPath As String = sNewProjDir & "\" & Path.GetFileName(sBTLFromPath) + File.Copy(sBTLFromPath, sBtlToPath) + Else + ErrorList.Add(String.Format("File BTL del progetto {0} non trovato", nImportProjId)) + End If + File.Copy(sProjFromPath(0), sProjFileName) + Catch ex As Exception + EgtOutLog("Impossibile copiare il file") + LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT) + MessageBox.Show("Impossibile copiare il file del progetto", "Errore") + Return + End Try + End If + ' aggiorno Db + Dim sBTLFileName As String = BTLFileNameList(nProjIndex) + Dim ExportDate As DateTime + DateTime.TryParse(Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPDATE & " " & + Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPTIME, ExportDate) + DbControllers.m_ProjController.UpdateInfo(nNewProjId, sBTLFileName, sBTLFileName, Map.refProjectVM.BTLStructureVM.sLISTNAME, ExportDate, nType, Machine.Name) + Else + ' elimino da Db + + ' CheckMe impostata come cancellazione FISICA dal DB... + DbControllers.m_ProjController.DeleteProj(nNewProjId, False) + End If + ' aggiorno BTLParts su DB + DbControllers.m_ProjController.UpdateBtlParts(nNewProjId, Map.refProjectVM.BTLStructureVM.BTLStructureM.BTLPartMList) + ' resetto stato new + DbControllers.m_ProjController.ResetNew(nNewProjId) + ' resetto lock + DbControllers.m_ProjController.LockByProjId(nNewProjId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + DbControllers.m_ProjController.ResetController() + Next + ' se tutte le operazioni precedenti sono andate a buon fine + If bOk Then + ' sostituisco indicazione nuovi proj nei pezzi + Dim nDuploLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, "DuploBase") + Dim nDuploId As Integer = EgtGetFirstInGroup(nDuploLayerId) + While nDuploId <> GDB_ID.NULL + ' recupero vecchio proj + Dim nOldProjId As Integer + EgtGetInfo(nDuploId, BTL_PRT_PROJ, nOldProjId) + ' lo cerco nella lista + Dim nOldProjIndex As Integer = ImportProjIdList.IndexOf(nOldProjId) + ' lo sostituisco + EgtSetInfo(nDuploId, BTL_PRT_PROJ, NewProjIdList(nOldProjIndex)) + nDuploId = EgtGetNext(nDuploId) + End While + ' resetto CurrProd per evitare di leggere valori produzione dal Db di quel progetto + Map.refProdManagerVM.CurrProd = Nothing + ' carico Machgroup che non verrebbero altrimenti importati + Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList())) + If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then + ' inizializzo nuovo progetto PROD + Dim nProdId As Integer = 0 + Dim sProdDir As String = "" + Map.refProdManagerVM.InitNewProject(NewProjIdList(0), nProdId, sProdDir) + ' setto il PType del Prod + DbControllers.m_ProdController.UpdatePType(nProdId, nType) + ' setto la Macchina associata al Prod + DbControllers.m_ProdController.UpdateMachine(nProdId, sMachine) + For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList + ' aggiorno ProdId sui MachGroup + EgtSetInfo(MachGroup.Id, MGR_RPT_PRODID, nProdId) + If Map.refMainWindowVM.MainWindowM.nUserLevel < 5 OrElse GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) <> 1 Then + ' resetto tutti gli stati di CALC + MachGroup.ResetCalcTotalMachGroup() + End If + Next + If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) = 1 Then + ' riporto info di futuro aggiornamento machgroup + nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) + While nBTLInfoLayerId <> GDB_ID.NULL + EgtSetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, True) + nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO) + End While + End If + ' salvo il progetto PROD + EgtSaveFile(sProjFromPath(0), NGE.CMPTEXT) + ' copio file progetto + Dim sProjPath As String = String.Empty + Dim sProdPath As String = sProdDir & "\" & nProdId.ToString("0000") & ".nge" + If EgtGetCurrFilePath(sProjPath) AndAlso Not String.IsNullOrEmpty(sProjPath) Then + Try + File.Copy(sProjPath, sProdPath) + 'Map.refSceneHostVM.MainController.OpenProject(sProdPath) + bOk = True + Catch ex As Exception + EgtOutLog("Impossibile copiare il file") + bOk = False + End Try + End If + If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) = 1 Then + ' copio tutti i bwe + For Each CurrFile In Directory.GetFiles(sProjectimportDir) + If Path.GetExtension(CurrFile) = ".bwe" OrElse Path.GetExtension(CurrFile) = ".html" Then + File.Copy(CurrFile, sProdDir & "\" & Path.GetFileName(CurrFile)) + End If + Next + End If + If bOk Then + ' aggiungo altri proj a prod + For Each nProjId In NewProjIdList + DbControllers.m_ProdController.AddProj(nProdId, nProjId, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + Next + Else + ' elimino da DB + DbControllers.m_ProdController.DeleteProd(nProdId, True) + End If + Dim MyMachGroupList As New List(Of MyMachGroupM) + If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then + For Each MachGroup In Map.refProjectVM.MachGroupPanelVM.m_MyMachGroupPanelM.MachGroupMList + MyMachGroupList.Add(MachGroup) + Next + End If + ' aggiorno pezzi su Db + DbControllers.m_ProdController.UpdateMachGroup(nProdId, MyMachGroupList) + ' resetto lock + DbControllers.m_ProdController.LockByProdId(nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + End If + DbControllers.m_ProdController.ResetController() + End If + ' imposto progetto corrente + If NewProjIdList.Count > 0 Then + SetCurrProj(NewProjIdList(0)) + OpenProject(CurrProd) ' Da controllare + End If + ' ripristino eventuale CurrProd precedente + Map.refProdManagerVM.CurrProd = CurrProd + WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, Path.GetDirectoryName(ImportDlg.FileName)) + LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT) + End Sub + +#End Region ' ImportProject + +#Region "GoToSupervisor" + + ''' + ''' Returns a command that do Open. + ''' + Public ReadOnly Property GoToSupervisor_Command As ICommand + Get + If m_cmdGoToSupervisor Is Nothing Then + m_cmdGoToSupervisor = New Command(AddressOf GoToSupervisor) + End If + Return m_cmdGoToSupervisor + End Get + End Property + + ''' + ''' Execute the Open. This method is invoked by the OpenCommand. + ''' + Friend Sub GoToSupervisor() + If IsNothing(m_CurrProd) Then Return + ' apro supervisore + Dim sSupervisorName As String = "EgtBEAMWALL.SupervisorR32" + ' recupero processo del supervisore + Dim localProc As Process() = Process.GetProcessesByName(sSupervisorName) + 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 sSupervisorPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sSupervisorName & ".exe" + Try + Process.Start(sSupervisorPath, "1 " & CurrProd.nProdId) + Catch ex As Exception + EgtOutLog("Error: impossible starting supervisor from path " & sSupervisorPath) + End Try + End If + ' mando richiesta di apertura progetto in supervisore + 'Dim x = DbControllers.m_StatusMapController.GetProd + DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refOnlyProdManagerVM.CurrProd.nProdId, Map.refOnlyProdManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInSupervisorRequest, "") + End Sub + +#End Region ' GoToSupervisor + +#End Region ' Commands + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml new file mode 100644 index 00000000..42ce3c54 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml.vb new file mode 100644 index 00000000..b60c4a3d --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdProjectV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectVM.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectVM.vb new file mode 100644 index 00000000..fdbc48c9 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectVM.vb @@ -0,0 +1,448 @@ +Imports System.Windows.Threading +Imports EgtBEAMWALL.Core +Imports EgtWPFLib5 +Imports EgtUILib +Imports System.Collections.ObjectModel + +Public Class OnlyProdProjectVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + Private m_Calc_Timer As New DispatcherTimer + + Private Property m_GridDims As New ObservableCollection(Of GridDimension) + Public Property GridDims As ObservableCollection(Of GridDimension) + Get + Return m_GridDims + End Get + Set + m_GridDims = Value + NotifyPropertyChanged(NameOf(GridDims)) + End Set + End Property + + Private m_BTLStructureVM As BTLStructureVM + Public Property BTLStructureVM As BTLStructureVM + Get + Return m_BTLStructureVM + End Get + Set(value As BTLStructureVM) + m_BTLStructureVM = value + NotifyPropertyChanged(NameOf(BTLStructureVM)) + End Set + End Property + + Private m_MachGroupPanelVM As MyMachGroupPanelVM + Public Property MachGroupPanelVM As MyMachGroupPanelVM + Get + Return m_MachGroupPanelVM + End Get + Set(value As MyMachGroupPanelVM) + m_MachGroupPanelVM = value + NotifyPropertyChanged(NameOf(MachGroupPanelVM)) + End Set + End Property + + Private m_bCalcRunning As Boolean = False + Public ReadOnly Property bCalcRunning As Boolean + Get + Return m_bCalcRunning + End Get + End Property + Private m_bLockUX As Boolean = False + + Private m_LeftPanel_Visibility As Boolean = True + Public Property LeftPanel_Visibility As Visibility + Get + Return If(m_LeftPanel_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_LeftPanel_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetLeftPanel_Visibility(IsVisible As Boolean) + m_LeftPanel_Visibility = IsVisible + End Sub + + Private m_TopPanel_Visibility As Boolean = False + Public Property TopPanel_Visibility As Visibility + Get + Return If(m_TopPanel_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_TopPanel_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetTopPanel_Visibility(IsVisible As Boolean) + m_TopPanel_Visibility = IsVisible + End Sub + + Private m_BottomPanel_Visibility As Boolean = True + Public Property BottomPanel_Visibility As Visibility + Get + Return If(m_BottomPanel_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_BottomPanel_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetBottomPanel_Visibility(IsVisible As Boolean) + m_BottomPanel_Visibility = IsVisible + End Sub + + Private m_PartManager_Visibility As Boolean = True + Public ReadOnly Property PartManager_Visibility As Visibility + Get + 'Return If(Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelectionType = BTLStructureVM.SelectionTypes.SELECT_ AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed) + If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelectionType = BTLStructureVM.SelectionTypes.SELECT_ AndAlso Not Map.refFreeContourManagerVM.bIsActive) Then + Return Visibility.Visible + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + Return Visibility.Visible + Else + Return Visibility.Collapsed + End If + End Get + End Property + + Private m_FeatureManager_Visibility As Boolean = True + Public Property FeatureManager_Visibility As Visibility + Get + Return If(m_FeatureManager_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_FeatureManager_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetFeatureManager_Visibility(IsVisible As Boolean) + m_FeatureManager_Visibility = IsVisible + End Sub + + Private m_ShowBeamPanel_Visibility As Boolean = True + Public Property ShowBeamPanel_Visibility As Visibility + Get + Return If(m_ShowBeamPanel_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_ShowBeamPanel_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetShowBeamPanel_Visibility(IsVisible As Boolean) + m_ShowBeamPanel_Visibility = IsVisible + End Sub + + Private m_ProjManager_Visibility As Boolean = True + Public Property ProjManager_Visibility As Visibility + Get + Return If(m_ProjManager_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_ProjManager_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetProjManager_Visibility(IsVisible As Boolean) + m_ProjManager_Visibility = IsVisible + Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.GoToProd_Visibility)) + End Sub + + Private m_ProdManager_Visibility As Boolean = True + Public Property ProdManager_Visibility As Visibility + Get + Return If(m_ProdManager_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_ProdManager_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetProdManager_Visibility(IsVisible As Boolean) + m_ProdManager_Visibility = IsVisible + Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.GoToProj_Visibility)) + End Sub + + Private m_FullCompleteManager_Visibility As Boolean = True + Public Property FullCompleteManager_Visibility As Visibility + Get + Return If(m_FullCompleteManager_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_FullCompleteManager_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetFullCompleteManager_Visibility(IsVisible As Boolean) + m_FullCompleteManager_Visibility = IsVisible + Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.GoToProd_Visibility)) + End Sub + + Private m_OptimizePanel_Visibility As Boolean = True + Public Property OptimizePanel_Visibility As Visibility + Get + Return If(m_OptimizePanel_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_OptimizePanel_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetOptimizePanel_Visibility(IsVisible As Boolean) + m_OptimizePanel_Visibility = IsVisible + NotifyPropertyChanged(NameOf(OptimizePanel_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.CalcRotFlip_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.Optimize_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.OriginType_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.ViewPage_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.MachiningPage_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.NestingOption_Visibility)) + End Sub + + Friend Sub NotifyCalcPanel_Visibility() + Map.refCALCPanelVM.NotifyPropertyChanged(NameOf(Map.refCALCPanelVM.ViewPage_Visibility)) + Map.refCALCPanelVM.NotifyPropertyChanged(NameOf(Map.refCALCPanelVM.Edit_Visibility)) + End Sub + + Private m_FreeContourManager_Visibility As Boolean = False + Public Property FreeContourManager_Visibility As Visibility + Get + Return If(m_FreeContourManager_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_FreeContourManager_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetFreeContourManager_Visibility(IsVisible As Boolean) + m_FreeContourManager_Visibility = IsVisible + NotifyPropertyChanged("FreeContourManager_Visibility") + End Sub + + Friend Sub NotifyAllPanelVisibility() + NotifyPropertyChanged("LeftPanel_Visibility") + NotifyPropertyChanged("TopPanel_Visibility") + NotifyPropertyChanged("BottomPanel_Visibility") + NotifyPropertyChanged("PartManager_Visibility") + NotifyPropertyChanged("FeatureManager_Visibility") + NotifyPropertyChanged("ShowBeamPanel_Visibility") + NotifyPropertyChanged("ProjManager_Visibility") + NotifyPropertyChanged("ProdManager_Visibility") + NotifyPropertyChanged("FullCompleteManager_Visibility") + NotifyCalcPanel_Visibility() + End Sub + +#End Region ' FIELDS & PROPERTIES + +#Region "Messages" + + Public ReadOnly Property ProduceRawPart_ToolTip As String + Get + Return EgtMsg(61912) + End Get + End Property + + Public ReadOnly Property ResetCALCRawPart_ToolTip As String + Get + Return EgtMsg(61924) + End Get + End Property + + Public ReadOnly Property ProduceAllRawPart_ToolTip As String + Get + Return EgtMsg(61913) + End Get + End Property + + Public ReadOnly Property CopyRawPart_ToolTip As String + Get + Return EgtMsg(61914) + End Get + End Property + + Public ReadOnly Property RemoveRawPart_ToolTip As String + Get + Return EgtMsg(61915) + End Get + End Property + + Public ReadOnly Property RemoveAllRawPart_ToolTip As String + Get + Return EgtMsg(61976) + End Get + End Property + + Public ReadOnly Property ReOrderPart_ToolTip As String + Get + Return EgtMsg(61916) + End Get + End Property + + Public ReadOnly Property MoveUpPart_ToolTip As String + Get + Return EgtMsg(61917) + End Get + End Property + + Public ReadOnly Property MoveDownPart_ToolTip As String + Get + Return EgtMsg(61918) + End Get + End Property + + Public ReadOnly Property RemovePart_ToolTip As String + Get + Return EgtMsg(61919) + End Get + End Property + + Public ReadOnly Property MovePartInRawPart_ToolTip As String + Get + Return EgtMsg(61944) + End Get + End Property + +#End Region ' Messages + +#Region "CONSTRUCTOR" + + Sub New() + ' Creo riferimento a questa classe in Map + Map.SetRefProjectVM(Me) + ' imposto timer per aggiornamenti Calc + m_Calc_Timer.Interval = TimeSpan.FromMilliseconds(500) + AddHandler m_Calc_Timer.Tick, AddressOf Calc_Timer_Tick + ' imposto dimensioni colonne/righe della Grid + DimensionsIniFile.ReadGridDimensions(ConstDims.PROJECT_VIEW, GridDims) + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Friend Sub SetCalcRunning(value As Boolean) + If value Then m_Calc_Timer.Start() + m_bCalcRunning = value + End Sub + + Friend Sub ManageIsEnabled(bIsEnabled As Boolean) + Map.refInstrumentPanelVM.SetInstrumentPanelIsEnabled(bIsEnabled) + Map.refCALCPanelVM.SetCalcPanelIsEnabled(bIsEnabled) + Map.refMainMenuVM.SetMainMenuIsEnabled(bIsEnabled) + Map.refPartManagerVM.SetPartManagerIsEnabled(bIsEnabled) + Map.refLeftPanelVM.SetLeftPanelIsEnabled(bIsEnabled) + Map.refProjManagerVM.SetProjManagerIsEnabled(bIsEnabled) + Map.refProdManagerVM.SetProdManagerIsEnabled(bIsEnabled) + Map.refTopPanelVM.SetTopPanelIsEnabled(bIsEnabled) + Map.refOptimizePanelVM.SetOptimizePanelIsEnabled(bIsEnabled) + Map.refFeatureManagerVM.SetFeatureManagerIsEnabled(bIsEnabled) + End Sub + + Private Sub Calc_Timer_Tick() + If m_bCalcRunning <> m_bLockUX Then + ' se calcolo iniziato + If m_bCalcRunning Then + ManageIsEnabled(False) + ' aggiungere gestione colonne editabili delle tabelle + If Not IsNothing(Map.refPartListVM.colPart_Do) Then + Map.refPartListVM.colPart_Do.IsReadOnly = True + End If + If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then + Map.refFeatureListVM.colFeature_Do.IsReadOnly = True + End If + If Not IsNothing(Map.refPParameterListVM.colPParam_Value) Then + Map.refPParameterListVM.colPParam_Value.IsReadOnly = True + End If + If Not IsNothing(Map.refQParameterListVM.colQParam_Value) Then + Map.refQParameterListVM.colQParam_Value.IsReadOnly = True + End If + If Not IsNothing(Map.refQParameterListVM.colQParam_Custom) Then + Map.refQParameterListVM.colQParam_Custom.IsReadOnly = True + End If + If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then + Map.refRawPartListVM.colRawPart_StartCut.IsReadOnly = True + End If + If Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then + Map.refRawPartListVM.colRawPart_W.IsReadOnly = True + End If + If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then + Map.refRawPartListVM.colRawPart_L.IsReadOnly = True + End If + If Not IsNothing(Map.refRawPartListVM.colRawPart_PosZ) Then + Map.refRawPartListVM.colRawPart_PosZ.IsReadOnly = True + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then + Map.refPartInRawPartListVM.colPartInRawPart_Offset.IsReadOnly = True + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then + Map.refPartInRawPartListVM.colPartInRawPart_Rot.IsReadOnly = True + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then + Map.refPartInRawPartListVM.colPartInRawPart_Flip.IsReadOnly = True + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then + Map.refPartInRawPartListVM.colPartInRawPart_PosX.IsReadOnly = True + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then + Map.refPartInRawPartListVM.colPartInRawPart_PosY.IsReadOnly = True + End If + If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then + Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = True + End If + m_bLockUX = True + ' se calcolo finito + Else + ManageIsEnabled(True) + ' aggiungere gestione colonne editabili delle tabelle + If Not IsNothing(Map.refPartListVM.colPart_Do) Then + Map.refPartListVM.colPart_Do.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then + Map.refFeatureListVM.colFeature_Do.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refPParameterListVM.colPParam_Value) Then + Map.refPParameterListVM.colPParam_Value.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refQParameterListVM.colQParam_Value) Then + Map.refQParameterListVM.colQParam_Value.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refQParameterListVM.colQParam_Custom) Then + Map.refQParameterListVM.colQParam_Custom.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then + Map.refRawPartListVM.colRawPart_StartCut.ResetToOrigIsReadOnly() + End If + If m_BTLStructureVM.nPROJTYPE <> BWType.BEAM AndAlso Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then + Map.refRawPartListVM.colRawPart_W.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then + Map.refRawPartListVM.colRawPart_L.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refRawPartListVM.colRawPart_PosZ) Then + Map.refRawPartListVM.colRawPart_PosZ.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then + Map.refPartInRawPartListVM.colPartInRawPart_Offset.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then + Map.refPartInRawPartListVM.colPartInRawPart_Rot.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then + Map.refPartInRawPartListVM.colPartInRawPart_Flip.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then + Map.refPartInRawPartListVM.colPartInRawPart_PosX.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then + Map.refPartInRawPartListVM.colPartInRawPart_PosY.ResetToOrigIsReadOnly() + End If + If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then + Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.ResetToOrigIsReadOnly() + End If + ' fermo il timer + If Not m_bCalcRunning Then + m_Calc_Timer.Stop() + m_bLockUX = False + End If + End If + End If + + End Sub + +#End Region ' METHODS + +End Class + diff --git a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb index de3a9c17..9897a81f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb @@ -113,9 +113,18 @@ Public Class OptimizePanelVM End Property Public ReadOnly Property Optimize_Visibility As Visibility Get - Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso - (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse - (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))), Visibility.Visible, Visibility.Collapsed) + 'Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso + ' (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse + ' (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))), Visibility.Visible, Visibility.Collapsed) + + If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse + (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))) Then + Return Visibility.Visible + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + Return Visibility.Visible + End If + + Return Visibility.Collapsed End Get End Property @@ -132,7 +141,7 @@ Public Class OptimizePanelVM End Property Public ReadOnly Property MachiningPage_Visibility As Visibility Get - Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING, Visibility.Visible, Visibility.Collapsed) + Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING Or Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) End Get End Property diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml index 7c4ae8d4..48b0db7a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml @@ -6,7 +6,7 @@ IsRightDockable="False" IsEnabled="{Binding ProdManager_IsEnabled}" Style="{StaticResource ToolBar_EgtFloatingPanel}"> - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb index 0ab55fd2..e90a07ba 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb @@ -84,6 +84,12 @@ Public Class ProdManagerVM End Get End Property + Public ReadOnly Property GoToProj_Visibility As Visibility + Get + Return If(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Collapsed, Visibility.Visible) + End Get + End Property + Private m_AddProj_Visibility As Visibility Public ReadOnly Property AddProj_Visibility As Visibility Get @@ -143,6 +149,7 @@ Public Class ProdManagerVM Else m_GoToSupervisor_Visibility = Visibility.Collapsed End If + ' attivo bottone AddProj If GetMainPrivateProfileInt(S_GENERAL, K_ADDPROJ, 0) = 1 Then m_AddProj_Visibility = Visibility.Visible diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml index 02f5924c..d317c5e4 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml @@ -74,6 +74,7 @@ diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb index 6d66aba7..92a786f1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb @@ -104,6 +104,12 @@ Public Class ProjManagerVM End Set End Property + Public ReadOnly Property GoToProd_Visibility As Visibility + Get + Return If(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Collapsed, Visibility.Visible) + End Get + End Property + ' Definizione comandi Private m_cmdNew As ICommand Private m_cmdOpen As ICommand diff --git a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml index 28ae79e8..68f3c305 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml @@ -3,7 +3,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" - xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"> + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" + DataContext="{StaticResource ProjectVM}"> @@ -79,8 +80,8 @@ + DataContext="{StaticResource FreeContourInputVM}" + Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/> BWType.BEAM) + If Not IsNothing(Map.refTopPanelVM) Then + Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) + Else + Map.refProjectVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) + End If Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) - If Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd - DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) - ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel - Map.refCALCPanelVM.LoadMachineList() - End If - If Map.refMainMenuVM.SelPage = Pages.VIEW Then + If Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then + 'Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd + CurrProd = Map.refProdManagerVM.TempCurrProd + ElseIf Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) Then + 'Map.refFullCompleteManagerVM.CurrProd = Map.refFullCompleteManagerVM.TempCurrProd + CurrProd = Map.refOnlyProdManagerVM.TempCurrProd + End If + 'DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + DbControllers.m_ProdController.LockByProdId(CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel + Map.refCALCPanelVM.LoadMachineList() + End If + If Map.refMainMenuVM.SelPage = Pages.VIEW Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROJ, 3, EgtMsg(63006), 70, 100) ' Loading graphics ' mostro tutti i pezzi Map.refShowBeamPanelVM.ShowAll(True) - ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then + ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then ' recupero indice di modifica progetto quando caricato Dim CommIndex As Integer = -1 Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd(m_SupervisorId) For Each ActiveSession In ActiveSessionList - If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso ActiveSession.ItemId = Map.refProdManagerVM.CurrProd.nProdId Then + 'If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso ActiveSession.ItemId = Map.refProdManagerVM.CurrProd.nProdId Then + If Not IsNothing(CurrProd) AndAlso ActiveSession.ItemId = CurrProd.nProdId Then CommIndex = ActiveSession.Index End If Next @@ -593,9 +617,17 @@ Public Class MySceneHostVM ' carico gruppi di lavorazione Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList())) ' fisso indice sessione di comunicazione + 'If CommIndex > -1 Then + ' Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex) + 'End If If CommIndex > -1 Then - Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex) + If Not IsNothing(Map.refProdManagerVM.CurrProd) Then + Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex) + ElseIf Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then + Map.refOnlyProdManagerVM.CurrProd.SetModificationIndex(CommIndex) + End If End If + ' seleziono primo gruppo If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup() @@ -616,7 +648,7 @@ Public Class MySceneHostVM If ProjectType = ProjectType.PROD Then Map.refProdManagerVM.m_MruFiles.Remove(sFile) MessageBox.Show(EgtMsg(10003) & " '" & sFile & "'", EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error opening file Map.refProjManagerVM.NewProject() - If Map.refMainMenuVM.SelPage = Pages.MACHINING Then + If Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList())) End If End If diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/StatisticsTimePanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/StatisticsTimePanelVM.vb index f8215cb7..caa75b3e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/StatisticsTimePanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/StatisticsTimePanelVM.vb @@ -17,7 +17,7 @@ Public Class StatisticsTimePanelVM End Property Public ReadOnly Property MachiningPage_Visibility As Visibility Get - Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING, Visibility.Visible, Visibility.Collapsed) + Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) End Get End Property diff --git a/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelV.xaml index 38c7e88a..2b617bd5 100644 --- a/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelV.xaml @@ -31,7 +31,7 @@ + HorizontalAlignment="Right"> Public Sub AddToRawPart() - If IsNothing(Map.refProdManagerVM.CurrProd) Then Return + 'If IsNothing(Map.refProdManagerVM.CurrProd) Then Return + If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso IsNothing(Map.refProdManagerVM) Then + Return + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then + Return + End If Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() For Index = 0 To SelParts.Count() - 1 @@ -964,7 +1002,12 @@ Public Class LeftPanelVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub CopyPart() - If IsNothing(Map.refProjManagerVM.CurrProj) Then Return + 'If IsNothing(Map.refProjManagerVM.CurrProj) Then Return + If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then + Return + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then + Return + End If Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart If IsNothing(SelPart) Then Return ' creo copia @@ -995,7 +1038,12 @@ Public Class LeftPanelVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub AddPart(ByVal param As Object) - If IsNothing(Map.refProjManagerVM.CurrProj) Then Return + 'If IsNothing(Map.refProjManagerVM.CurrProj) Then Return + If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then + Return + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then + Return + End If ' apro finestra di definizione nuovo part Dim AddPartWndVM As New AddPartWndVM() Dim AddPartWnd As New AddPartWndV(Application.Current.MainWindow, AddPartWndVM) @@ -1003,7 +1051,12 @@ Public Class LeftPanelVM ' creo nuovo part Dim nNewPartId As Integer = EgtBeamCreatePart() ' scrivo info proj - EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId) + 'EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId) + If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then + EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId) + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then + EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.CurrProd.nProdId) + End If EgtBeamSetPartProdNbr(AddPartWndVM.nPDN) If Not IsNothing(AddPartWndVM.sNAM) Then EgtBeamSetPartName(AddPartWndVM.sNAM) EgtBeamSetPartCount(AddPartWndVM.nCNT) @@ -1058,7 +1111,12 @@ Public Class LeftPanelVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub RemovePartCmd() - If IsNothing(Map.refProjManagerVM.CurrProj) Then Return + 'If IsNothing(Map.refProjManagerVM.CurrProj) Then Return + If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then + Return + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then + Return + End If If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then Dim CurrSelBTLParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() For RemoveIndex = CurrSelBTLParts.Count - 1 To 0 Step -1 @@ -1131,7 +1189,14 @@ Public Class LeftPanelVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub Invert() - If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return + 'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return + If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then + Return + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then + Return + ElseIf IsNothing(Map.refProjectVM.BTLStructureVM) Then + Return + End If ' se modalita' assemblato Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then @@ -1166,7 +1231,14 @@ Public Class LeftPanelVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub BackRotation() - If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return + 'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return + If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then + Return + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then + Return + ElseIf IsNothing(Map.refProjectVM.BTLStructureVM) Then + Return + End If ' salvo sezione impostata Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection ' se modalita' assemblato @@ -1210,7 +1282,14 @@ Public Class LeftPanelVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub ForwardRotation() - If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return + 'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return + If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then + Return + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then + Return + ElseIf IsNothing(Map.refProjectVM.BTLStructureVM) Then + Return + End If ' salvo sezione impostata Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection ' se modalita' assemblato diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml index d3613d2b..e256301b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml @@ -88,7 +88,7 @@ Style="{StaticResource LeftPanel_Button}"> - - + - + + + + @@ -143,16 +151,16 @@ Margin="5,5,2.5,5"> - + - + @@ -169,7 +177,7 @@ - + @@ -185,27 +193,27 @@ + Tag="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/> + Height="3" + HorizontalAlignment="Stretch" + Visibility="{Binding QParSplitter_Visibility}"/> + DataContext="{StaticResource DuploQParameterListVM}" + Tag="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/> + Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}" + Margin="5,0,5,0" + Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/> + Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}" + Margin="5,0,5,0" + Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/> + Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}" + Margin="5,0,5,0" + Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml new file mode 100644 index 00000000..a0c7a695 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml @@ -0,0 +1,29 @@ + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml.vb new file mode 100644 index 00000000..6127d0fd --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml.vb @@ -0,0 +1,11 @@ +Public Class OnlyProdOptimizePanelV + + Private Sub OptimizeBtn_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) + Dim OptimizeBtn = TryCast(sender, FrameworkElement) + + If OptimizeBtn IsNot Nothing Then + OptimizeBtn.ContextMenu.IsOpen = True + End If + End Sub + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb index 9897a81f..1427c827 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb @@ -113,18 +113,18 @@ Public Class OptimizePanelVM End Property Public ReadOnly Property Optimize_Visibility As Visibility Get - 'Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso - ' (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse - ' (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))), Visibility.Visible, Visibility.Collapsed) + Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso + (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse + (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))), Visibility.Visible, Visibility.Collapsed) - If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse - (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))) Then - Return Visibility.Visible - ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then - Return Visibility.Visible - End If + 'If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse + ' (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))) Then + ' Return Visibility.Visible + 'ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + ' Return Visibility.Visible + 'End If - Return Visibility.Collapsed + 'Return Visibility.Collapsed End Get End Property diff --git a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectVM.vb b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectVM.vb index 493476e8..53e5fcf0 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectVM.vb @@ -11,6 +11,18 @@ Public Class ProjectVM Private m_Calc_Timer As New DispatcherTimer + ' Selezione Tab Prod / Proj + Private m_SelProdProj As ProdProj + Public Property SelProdProj As Integer + Get + Return m_SelProdProj + End Get + Set(value As Integer) + m_SelProdProj = value + NotifyPropertyChanged(NameOf(SelProdProj)) + End Set + End Property + Private Property m_GridDims As New ObservableCollection(Of GridDimension) Public Property GridDims As ObservableCollection(Of GridDimension) Get @@ -142,7 +154,7 @@ Public Class ProjectVM End Property Friend Sub SetProjManager_Visibility(IsVisible As Boolean) m_ProjManager_Visibility = IsVisible - Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.GoToProd_Visibility)) + If Not IsNothing(Map.refProjManagerVM) Then Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.GoToProd_Visibility)) End Sub Private m_ProdManager_Visibility As Boolean = True @@ -156,21 +168,7 @@ Public Class ProjectVM End Property Friend Sub SetProdManager_Visibility(IsVisible As Boolean) m_ProdManager_Visibility = IsVisible - Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.GoToProj_Visibility)) - End Sub - - Private m_OnlyProdManager_Visibility As Boolean = True - Public Property OnlyProdManager_Visibility As Visibility - Get - Return If(m_OnlyProdManager_Visibility, Visibility.Visible, Visibility.Collapsed) - End Get - Set(value As Visibility) - m_OnlyProdManager_Visibility = (value = Visibility.Visible) - End Set - End Property - Friend Sub SetOnlyProdManager_Visibility(IsVisible As Boolean) - m_OnlyProdManager_Visibility = IsVisible - Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.GoToProd_Visibility)) + If Not IsNothing(Map.refProdManagerVM) Then Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.GoToProj_Visibility)) End Sub Private m_OptimizePanel_Visibility As Boolean = True @@ -212,7 +210,93 @@ Public Class ProjectVM NotifyPropertyChanged("FreeContourManager_Visibility") End Sub -#End Region ' FIELDS & PROPERTIES + ' OnlyProdProject + + Private m_OnlyProdManager_Visibility As Boolean = True + Public Property OnlyProdManager_Visibility As Visibility + Get + Return If(m_OnlyProdManager_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_OnlyProdManager_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetOnlyProdManager_Visibility(IsVisible As Boolean) + m_OnlyProdManager_Visibility = IsVisible + End Sub + + Private m_OnlyProdLeftPanel_Visibility As Boolean = True + Public Property OnlyProdLeftPanel_Visibility As Visibility + Get + Return If(m_OnlyProdLeftPanel_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_OnlyProdLeftPanel_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetOnlyProdLeftPanel_Visibility(IsVisible As Boolean) + m_OnlyProdLeftPanel_Visibility = IsVisible + End Sub + + Private m_OnlyProdOptimizePanel_Visibility As Boolean = True + Public Property OnlyProdOptimizePanel_Visibility As Visibility + Get + Return If(m_OnlyProdOptimizePanel_Visibility, Visibility.Visible, Visibility.Collapsed) + End Get + Set(value As Visibility) + m_OnlyProdOptimizePanel_Visibility = (value = Visibility.Visible) + End Set + End Property + Friend Sub SetOnlyProdOptimizePanel_Visibility(IsVisible As Boolean) + m_OnlyProdOptimizePanel_Visibility = IsVisible + NotifyPropertyChanged(NameOf(OnlyProdOptimizePanel_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.CalcRotFlip_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.Optimize_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.OriginType_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.ViewPage_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.MachiningPage_Visibility)) + Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.NestingOption_Visibility)) + End Sub + + Private m_CopyFeature_IsEnabled As Boolean = False + Public Property CopyFeature_IsEnabled As Boolean + Get + Return m_CopyFeature_IsEnabled + End Get + Set(value As Boolean) + m_CopyFeature_IsEnabled = value + NotifyPropertyChanged(NameOf(CopyFeature_IsEnabled)) + End Set + End Property + + Private m_MacroFeature_IsEnabled As Boolean = False + Public Property MacroFeature_IsEnabled As Boolean + Get + Return m_MacroFeature_IsEnabled + End Get + Set(value As Boolean) + m_MacroFeature_IsEnabled = value + NotifyPropertyChanged(NameOf(MacroFeature_IsEnabled)) + End Set + End Property + + ' Definizione Comandi + Private m_cmdCopyFeature As ICommand + Private m_cmdMacroFeature As ICommand + Private m_cmdAddFeature As ICommand + Private m_cmdRemoveFeature As ICommand + Private m_cmdProduceAllRawPart As ICommand + Private m_cmdProduceRawPart As ICommand + Private m_cmdCopyRawPart As ICommand + Private m_cmdRemoveRawPart As ICommand + Private m_cmdRemoveAllRawPart As ICommand + Private m_cmdRemovePart As ICommand + Private m_cmdMoveUpPart As ICommand + Private m_cmdMoveDownPart As ICommand + Private m_cmdReOrderPart As ICommand + Private m_cmdMovePartInRawPart As ICommand + +#End Region ' Fields & Properties #Region "Messages" @@ -282,6 +366,31 @@ Public Class ProjectVM End Get End Property + Public ReadOnly Property CopyFeature_ToolTip As String + Get + Return EgtMsg(61908) + End Get + End Property + + Public ReadOnly Property MacroFeature_ToolTip As String + Get + Return EgtMsg(61909) + End Get + End Property + + Public ReadOnly Property AddFeature_ToolTip As String + Get + Return EgtMsg(61910) + End Get + End Property + + Public ReadOnly Property RemoveFeature_ToolTip As String + Get + Return EgtMsg(61911) + End Get + End Property + + #End Region ' Messages #Region "CONSTRUCTOR" @@ -297,7 +406,7 @@ Public Class ProjectVM DimensionsIniFile.ReadGridDimensions(ProjectGridDim, GridDims) End Sub -#End Region ' CONSTRUCTOR +#End Region ' Constructor #Region "METHODS" @@ -458,7 +567,589 @@ Public Class ProjectVM NotifyCalcPanel_Visibility() End Sub -#End Region ' METHODS +#End Region ' Methods + +#Region "COMMAND" + +#Region "CopyFeature" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property CopyFeature_Command As ICommand + Get + If m_cmdCopyFeature Is Nothing Then + m_cmdCopyFeature = New Command(AddressOf CopyFeature) + End If + Return m_cmdCopyFeature + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub CopyFeature() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart + If IsNothing(SelPart) Then Return + Dim SelFeature As BTLFeatureVM = SelPart.SelBTLFeatureVM + If IsNothing(SelFeature) Then Return + ' creo copia + Dim NewFeature = SelFeature.Copy() + If Not IsNothing(NewFeature) Then + SelPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.FirstOrDefault(Function(x) x.BTLFeatureM Is NewFeature) + EgtDuploSetModified(SelPart.nPartId) + End If + SelPart.ResetCalcPart() + End Sub + +#End Region ' CopyFeature + +#Region "MacroFeature" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property MacroFeature_Command As ICommand + Get + If m_cmdMacroFeature Is Nothing Then + m_cmdMacroFeature = New Command(AddressOf MacroFeature) + End If + Return m_cmdMacroFeature + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub MacroFeature() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return + ' apro finestra di creazione macro + Dim MacroFeatureWndVM As New MacroFeatureWndVM() + Dim MacroFeatureWnd As New MacroFeatureWndV(Application.Current.MainWindow, MacroFeatureWndVM) + If MacroFeatureWnd.ShowDialog() Then + + End If + End Sub + +#End Region ' MacroFeature + +#Region "AddFeature" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property AddFeature_Command As ICommand + Get + If m_cmdAddFeature Is Nothing Then + m_cmdAddFeature = New Command(AddressOf AddFeature) + End If + Return m_cmdAddFeature + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub AddFeature(ByVal param As Object) + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return + ' apro finestra di definizione nuova feature + Dim AddFeatureWndVM As New AddFeatureWndVM() + Dim AddFeatureWnd As New AddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM) + If AddFeatureWnd.ShowDialog() Then + Dim NewFeat As BTLFeatureM + Dim nNewFeatureId As Integer = 0 + Dim bMacroFlag As Boolean = False + ' verifico se una Macro è selezionata + If AddFeatureWndVM.MacroList.Count > 0 AndAlso AddFeatureWndVM.nSelMacro >= 0 Then + ' Creo nuova feature sulla base della Macro selezionata + ' Creo table e setto variabili + EgtLuaCreateGlobTable("MACRO") + EgtLuaSetGlobNumVar("MACRO.L", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlL) + EgtLuaSetGlobNumVar("MACRO.W", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW) + EgtLuaSetGlobNumVar("MACRO.H", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH) + EgtLuaSetGlobIntVar("MACRO.PROCID", Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId()) + Dim bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroFilePathList(AddFeatureWndVM.nSelMacro)) + ' Leggo variabili + EgtLuaGetGlobIntVar("MACRO.FEATUREID", nNewFeatureId) + ' Reset lua + EgtLuaResetGlobVar("MACRO") + If Not bOk Then + MessageBox.Show(EgtMsg(61869), EgtMsg(30007)) + Return + End If + bMacroFlag = True + Else + ' Creo nuova feature (Macro non selezionata) + NewFeat = BTLFeatureM.CreateBTLFeature(AddFeatureWndVM.nSelPRC.nPRC, AddFeatureWndVM.nSelPRC.nGRP, AddFeatureWndVM.nSelPRC.nSIDE) + NewFeat.SetDefaultValues() + Dim vPar() As Double = Nothing + Dim sPar As String = String.Empty + Dim vParQ() As String = Nothing + NewFeat.CalcParamArray(vPar, sPar, vParQ) + ' aggiorno la feature con nuovo valore + EgtBeamSetPart(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId) + nNewFeatureId = EgtBeamAddProcess(NewFeat.nSelGRP, NewFeat.nPRC, NewFeat.nSelSIDE, "", + Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId(), + New Frame3d(), vPar, sPar, vParQ, GDB_ID.NULL, GDB_ID.NULL) + bMacroFlag = False + End If + ' se è stata creata + If nNewFeatureId <> GDB_ID.NULL Then + EgtDuploSetModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId) + ' la aggiungo a struttura BTL corrente + NewFeat = BTLFeatureM.CreateBTLFeature(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM, nNewFeatureId) + If Not bMacroFlag Then NewFeat.SetDefaultValues() + Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.AddBTLFeature(NewFeat) + Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.FirstOrDefault(Function(x) x.BTLFeatureM Is NewFeat) + Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart() + End If + End If + End Sub + +#End Region ' AddFeature + +#Region "RemoveFeature" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property RemoveFeature_Command As ICommand + Get + If m_cmdRemoveFeature Is Nothing Then + m_cmdRemoveFeature = New Command(AddressOf RemoveFeature) + End If + Return m_cmdRemoveFeature + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub RemoveFeature() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return + If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then Return + If EgtBeamEraseProcess(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nFeatureId) Then + EgtDuploSetModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId) + ' rimuovo dalla lista feature + Dim Index As Integer = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.IndexOf(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) + If Index = 0 Then + If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 0 Then + Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(0) + Else + Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing + End If + ElseIf Index = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 1 Then + If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 1 Then + Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 2) + Else + Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing + End If + Else + Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Index - 1) + End If + Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.RemoveAt(Index) + EgtDraw() + Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart() + End If + End Sub + +#End Region ' RemoveFeature + +#Region "ProduceRawPart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property ProduceRawPart_Command As ICommand + Get + If m_cmdProduceRawPart Is Nothing Then + m_cmdProduceRawPart = New Command(AddressOf ProduceRawPart) + End If + Return m_cmdProduceRawPart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub ProduceRawPart() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + Dim ErrorMsg As String = "" + ' se attiva opzione e non ancora calcolato + If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.SelectedMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then + Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCE) + Map.refCALCPanelVM.Verify() + Return + End If + If Not Produce(Map.refMachGroupPanelVM.SelectedMachGroup, ErrorMsg) AndAlso Not String.IsNullOrWhiteSpace(ErrorMsg) Then + MessageBox.Show(ErrorMsg) + End If + End Sub + + Private Function Produce(MachGroup As MyMachGroupVM, ByRef ErrorMsg As String) As Boolean + If IsNothing(MachGroup) Then Return False + ' se barra gia' assegnata a supervisore, esco + If MachGroup.nProduction_State >= ItemState.Assigned Then Return False + If MachGroup.nGlobalState = CalcStates.OK Or MachGroup.nGlobalState = CalcStates.INFO Then + ' se ci sono modifiche, salvo il pogetto + If EgtGetModified() Then + Map.refOnlyProdManagerVM.Save() + End If + ' mando al supervisore + DbControllers.m_MachGroupController.UpdateOrder(Map.refOnlyProdManagerVM.CurrProd.nProdId, MachGroup.Id, DbControllers.m_MachGroupController.GetMinIndex(Map.refOnlyProdManagerVM.CurrProd.nProdId) + 1) + DbControllers.m_MachGroupController.UpdateSupervisor(Map.refOnlyProdManagerVM.CurrProd.nProdId, MachGroup.Id, DbControllers.m_SupervisorId) + MachGroup.SentToSupervisor() + For Each Part As PartVM In MachGroup.PartVMList + DbControllers.m_PartController.UpdateStatus(Map.refOnlyProdManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.Assigned) + Part.nProduction_State = ItemState.Assigned + Part.NotifyPropertyChanged(NameOf(Part.Background)) + ' disabilito impostazione modificato + Dim DisableMgr As New DisableModifiedMgr + ' blocco modifica del pezzo + EgtDuploSetLocked(Part.nPartId) + ' ripristino precedente impostazione modificato + DisableMgr.ReEnable() + Next + Return True + Else + ErrorMsg = String.Format("Impossible sending {0} to supervisor because not machinable!", MachGroup.Name) + 'MessageBox.Show(String.Format("Impossible sending {0} to supervisor because it is not machinable!", MachGroup.Name)) + Return False + End If + End Function + +#End Region ' ProduceRawPart + +#Region "ProduceAllRawPart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property ProduceAllRawPart_Command As ICommand + Get + If m_cmdProduceAllRawPart Is Nothing Then + m_cmdProduceAllRawPart = New Command(AddressOf ProduceAllRawPart) + End If + Return m_cmdProduceAllRawPart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub ProduceAllRawPart() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + ' se attiva opzione e non ancora calcolato + If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State = ItemState.ND AndAlso x.nGlobalState = CalcStates.NOTCALCULATED) Then + Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCEALL) + Map.refCALCPanelVM.VerifyAll() + Return + End If + If Map.refMachGroupPanelVM.MachGroupVMList.Count > 0 Then + Dim MachgroupErrorList As New List(Of MachGroupVM) + For Each Machgroup In Map.refMachGroupPanelVM.MachGroupVMList + Dim ErrorMsg As String = "" + If Not Produce(Machgroup, ErrorMsg) AndAlso Not String.IsNullOrWhiteSpace(ErrorMsg) Then + MachgroupErrorList.Add(Machgroup) + End If + Next + If MachgroupErrorList.Count > 0 Then + Dim sMachGroups As String = "" + For Each MachGroup In MachgroupErrorList + sMachGroups &= " " & MachGroup.Name & "," + Next + sMachGroups = sMachGroups.Trim({" "c, ","c}) + MessageBox.Show(String.Format("Impossible sending {0} to supervisor because not machinable!", sMachGroups)) + End If + End If + End Sub + +#End Region ' ProduceAllRawPart + +#Region "CopyRawPart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property CopyRawPart_Command As ICommand + Get + If m_cmdCopyRawPart Is Nothing Then + m_cmdCopyRawPart = New Command(AddressOf CopyRawPart) + End If + Return m_cmdCopyRawPart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub CopyRawPart() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + Dim nQty As Integer = 1 + ' se premuto shift + If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then + Dim MultiCopyRawPartWndVM As New MultiCopyRawPartWndVM() + Dim MultiCopyRawPartWnd As New MultiCopyRawPartWndV(Application.Current.MainWindow, MultiCopyRawPartWndVM) + If Not MultiCopyRawPartWnd.ShowDialog() Then Return + nQty = MultiCopyRawPartWndVM.nQuantity + End If + Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup + If IsNothing(SelMachGroup) Then Return + ' creo copia + Dim NewMachGroup As MyMachGroupVM = SelMachGroup.Copy(nQty) + If Not IsNothing(NewMachGroup) Then + ' lo seleziono + Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = NewMachGroup + End If + End Sub + +#End Region ' CopyRawPart + +#Region "RemoveRawPart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property RemoveRawPart_Command As ICommand + Get + If m_cmdRemoveRawPart Is Nothing Then + m_cmdRemoveRawPart = New Command(AddressOf RemoveRawPartCmd) + End If + Return m_cmdRemoveRawPart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub RemoveRawPartCmd() + RemoveRawPart() + End Sub + + Public Sub RemoveRawPart(Optional bAll As Boolean = False) + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + ' se tutti + If bAll Then + ' cancello tutti + For Index = Map.refMachGroupPanelVM.MachGroupVMList.Count - 1 To 0 Step -1 + Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(Index) + ' se barra gia' assegnata a supervisore, esco + If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Continue For + CurrMachGroup.DeleteMachGroup(True) + Next + Else + Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup + If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return + SelMachGroup.DeleteMachGroup() + End If + EgtDraw() + ' se nessun grezzo, rimetto tutti i pezzi invisibili + If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then + Map.refProjectVM.BTLStructureVM.HideAll(True) + End If + End Sub + +#End Region ' RemoveRawPart + +#Region "RemoveAllRawPart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property RemoveAllRawPart_Command As ICommand + Get + If m_cmdRemoveAllRawPart Is Nothing Then + m_cmdRemoveAllRawPart = New Command(AddressOf RemoveAllRawPart) + End If + Return m_cmdRemoveAllRawPart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub RemoveAllRawPart() + RemoveRawPart(True) + End Sub + +#End Region ' RemoveRawPart + +#Region "RemovePart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property RemovePart_Command As ICommand + Get + If m_cmdRemovePart Is Nothing Then + m_cmdRemovePart = New Command(AddressOf RemovePart) + End If + Return m_cmdRemovePart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub RemovePart() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup + If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return + Dim SelPart As PartVM = SelMachGroup.SelPart + If IsNothing(SelPart) Then Return + SelPart.DeletePart() + SelMachGroup.UpdateUsage() + SelMachGroup.ResetCalcMachGroup() + End Sub + +#End Region ' RemovePart + +#Region "MoveUpPart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property MoveUpPart_Command As ICommand + Get + If m_cmdMoveUpPart Is Nothing Then + m_cmdMoveUpPart = New Command(AddressOf MoveUpPart) + End If + Return m_cmdMoveUpPart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub MoveUpPart() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup + If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return + Dim SelPart As PartVM = SelMachGroup.SelPart + If IsNothing(SelPart) Then Return + If SelMachGroup.nType = MachineType.BEAM Then + SelMachGroup.MoveBeam(SelPart, MoveDirections.UP) + EgtDraw() + ' riseleziono trave + SelMachGroup.SelPart = SelPart + End If + SelMachGroup.ResetCalcMachGroup() + End Sub + +#End Region ' MoveUpPart + +#Region "MoveDownPart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property MoveDownPart_Command As ICommand + Get + If m_cmdMoveDownPart Is Nothing Then + m_cmdMoveDownPart = New Command(AddressOf MoveDownPart) + End If + Return m_cmdMoveDownPart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub MoveDownPart() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup + If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return + Dim SelPart As PartVM = SelMachGroup.SelPart + If IsNothing(SelPart) Then Return + If SelMachGroup.nType = MachineType.BEAM Then + SelMachGroup.MoveBeam(SelPart, MoveDirections.DOWN) + EgtDraw() + ' riseleziono trave + SelMachGroup.SelPart = SelPart + End If + SelMachGroup.ResetCalcMachGroup() + End Sub + +#End Region ' MoveDownPart + +#Region "ReOrderPart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property ReOrderPart_Command As ICommand + Get + If m_cmdReOrderPart Is Nothing Then + m_cmdReOrderPart = New Command(AddressOf ReOrderPart) + End If + Return m_cmdReOrderPart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub ReOrderPart() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup + If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return + Dim SelPart As PartVM = SelMachGroup.SelPart + If IsNothing(SelPart) Then Return + If SelMachGroup.nType = MachineType.BEAM Then + SelMachGroup.ReorderBeam() + EgtDraw() + ' riseleziono trave + If Not IsNothing(SelPart) Then + SelMachGroup.SelPart = SelPart + End If + End If + SelMachGroup.ResetCalcMachGroup() + End Sub + +#End Region ' ReOrderPart + +#Region "MovePartInRawPart" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property MovePartInRawPart_Command As ICommand + Get + If m_cmdMovePartInRawPart Is Nothing Then + m_cmdMovePartInRawPart = New Command(AddressOf MovePartInRawPart) + End If + Return m_cmdMovePartInRawPart + End Get + End Property + + ''' + ''' Execute the Exec. This method is invoked by the ExecCommand. + ''' + Public Sub MovePartInRawPart() + If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return + Dim MovePartInRawPartWndVM As New MovePartInRawPartWndVM() + Dim MovePartInRawPartWnd As New MovePartInRawPartWndV(Application.Current.MainWindow, MovePartInRawPartWndVM) + If Not MovePartInRawPartWnd.ShowDialog() Then Return + End Sub + +#End Region ' MovePartInRawPart + + +#End Region ' Command End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb index 9fec89cf..22adf72d 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb @@ -154,17 +154,22 @@ Public Class ProdFileVM Directory.Delete(sProjectDirPath, True) Catch ex As Exception End Try - Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath) - Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames)) + If Not IsNothing(Map.refProdManagerVM) Then + Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath) + Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames)) + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath) + Map.refOnlyProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames)) + End If DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId, False) - If CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId Then + If CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId OrElse CurrProject.nProdId = Map.refOnlyProdManagerVM.CurrProj.nProdId Then ' reset prod in path proj Map.refProjManagerVM.UpdateCurrProj() End If Map.refProdManagerVM.CurrProd = Nothing - EgtResetModified() - Return MessageBoxResult.No - End If + EgtResetModified() + Return MessageBoxResult.No + End If End Select Else EgtResetModified() diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjectTypeWnd/ProjectTypeWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjectTypeWnd/ProjectTypeWndVM.vb index 63c1e102..2e211a36 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjectTypeWnd/ProjectTypeWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjectTypeWnd/ProjectTypeWndVM.vb @@ -35,8 +35,10 @@ Public Class ProjectTypeWndVM End Property ' Se la Macchina selezionata è di tipo BOTH verrà mostrata anche la selezione del Tipo - Private m_IsBoth_Visibility As Visibility = If(Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso - DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed) + 'Private m_IsBoth_Visibility As Visibility = If (Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso + ' DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed) + Private m_IsBoth_Visibility As Visibility = If(Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso + DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH OrElse Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd), Visibility.Visible, Visibility.Collapsed) Public Property IsBoth_Visibility As Visibility Get Return m_IsBoth_Visibility @@ -57,7 +59,7 @@ Public Class ProjectTypeWndVM End Property ' Se la Macchina selezionata è di tipo BOTH verrà selezionato di default il Tipo del progetto corrente - Private m_nSelType As BWType = If(Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso + Private m_nSelType As BWType = If(Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) AndAlso DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH, Map.refProjManagerVM.CurrProj.nType, Nothing) Public Property nSelType As BWType Get diff --git a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb index df7e779b..8ac7c03e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb @@ -557,9 +557,9 @@ Public Class MySceneHostVM Map.refCALCPanelVM.LoadMachineList() ElseIf ProjectType = ProjectType.PROD Then ' se salvato, carico progetto in lista mru - If Not IsNothing(Map.refProdManagerVM.TempCurrProd) AndAlso Not Map.refProdManagerVM.TempCurrProd.bIsNew Then + If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.TempCurrProd) AndAlso Not Map.refProdManagerVM.TempCurrProd.bIsNew Then Map.refProdManagerVM.m_MruFiles.Add(sFile) - ElseIf Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) AndAlso Not Map.refOnlyProdManagerVM.TempCurrProd.bIsNew Then + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) AndAlso Not Map.refOnlyProdManagerVM.TempCurrProd.bIsNew Then Map.refOnlyProdManagerVM.m_MruFiles.Add(sFile) End If ' imposto macchina del progetto @@ -571,9 +571,9 @@ Public Class MySceneHostVM Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine), Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.CurrProj.sMachine)) ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then - Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refProdManagerVM.TempCurrProd), - Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine), - Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.CurrProd.sMachine)) + Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd), + Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.CurrProd.sMachine), + Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine)) End If SectionXMaterial.SetType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) Core.ViewPanelVM.UpdateBWType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) @@ -582,16 +582,16 @@ Public Class MySceneHostVM Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType) If Not IsNothing(Map.refTopPanelVM) Then Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) - Else - Map.refProjectVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) + 'Else + ' Map.refProjectVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) End If Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) - If Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then - 'Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd - CurrProd = Map.refProdManagerVM.TempCurrProd - ElseIf Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) Then - 'Map.refFullCompleteManagerVM.CurrProd = Map.refFullCompleteManagerVM.TempCurrProd - CurrProd = Map.refOnlyProdManagerVM.TempCurrProd + If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then + 'Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd + CurrProd = Map.refProdManagerVM.TempCurrProd + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) Then + 'Map.refFullCompleteManagerVM.CurrProd = Map.refFullCompleteManagerVM.TempCurrProd + CurrProd = Map.refOnlyProdManagerVM.TempCurrProd End If 'DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) DbControllers.m_ProdController.LockByProdId(CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) @@ -689,7 +689,13 @@ Public Class MySceneHostVM If Not IsNothing(PjFileVM.ProjFileM) AndAlso Not IsNothing(PjFileVM.sProjPath) Then Map.refProjManagerVM.m_MruFiles.Add(PjFileVM.sProjPath) End If End If - If ProjectType = ProjectType.PROD Then Map.refProdManagerVM.m_MruFiles.Add(sFile) + If ProjectType = ProjectType.PROD Then + If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProdManagerVM) Then + Map.refProdManagerVM.m_MruFiles.Add(sFile) + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.m_MruFiles.Add(sFile) + End If + End If ' Salvo nome ultimo file WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile) End Sub @@ -737,12 +743,16 @@ Public Class MySceneHostVM ' scrivo info proj e type su layer BtlInfo Dim nBTLInfoLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) - EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refProjManagerVM.CurrProj.nType) + If Not IsNothing(Map.refProjManagerVM.CurrProj) Then + EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refProjManagerVM.CurrProj.nType) + Else + EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refOnlyProdManagerVM.CurrProd.nType) + End If ' scrivo info proj su layer AsseBase Dim nAsseBaseLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) - EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) - Else - Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file + EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) + Else + Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error Map.refProjManagerVM.NewProject() End If diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb index c1b7a909..33995a19 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb @@ -170,7 +170,7 @@ Public Class ShowBeamPanelVM Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.NULL) Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility)) ' mostro in parte bassa dati BTL - Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.STRUCTURE_) + If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.STRUCTURE_) ' mostro tutti i pezzi Map.refProjectVM.BTLStructureVM.ShowAll(False) ' deseleziono tutto From 91d943d0a701c4ad3742937b1f2bddf0fea28ab5 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Mon, 30 Oct 2023 12:28:58 +0100 Subject: [PATCH 019/126] Aggiunta tab vuoto a tab prod/proj e controllo pulsanti --- EgtBEAMWALL.Core/Constants/ConstGen.vb | 5 +- .../ItemParamList/BTLPartListV.xaml.vb | 2 + .../MachGroupPanel/MyMachGroupVM.vb | 6 +- .../OnlyProdManager/OnlyProdManagerVM.vb | 190 ++++++++++-------- .../OnlyProdProject/OnlyProdProjectV.xaml | 1 + .../Project/ProjectVM.vb | 6 +- .../ProjectFileVM/ProdFileVM.vb | 22 +- .../ProjectFileVM/ProjFileVM.vb | 25 ++- .../SceneHost/MySceneHostVM.vb | 48 +++-- .../Utility/LuaExec.vb | 6 +- 10 files changed, 187 insertions(+), 124 deletions(-) diff --git a/EgtBEAMWALL.Core/Constants/ConstGen.vb b/EgtBEAMWALL.Core/Constants/ConstGen.vb index aadcd7d3..3cb0d9a2 100644 --- a/EgtBEAMWALL.Core/Constants/ConstGen.vb +++ b/EgtBEAMWALL.Core/Constants/ConstGen.vb @@ -48,8 +48,9 @@ Public Module ConstGen ' Selezione Tab Prod / Proj Public Enum ProdProj As Integer - PROJ = 0 - PROD = 1 + NULL = 0 + PROJ = 1 + PROD = 2 End Enum ' File di log generale diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb index 8f40ee05..9e6a9191 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb @@ -1,4 +1,5 @@ Imports System.Reflection +Imports EgtBEAMWALL.Core.ConstGen Public Class BTLPartListV @@ -46,6 +47,7 @@ Public Class BTLPartListV e.Handled = True ElseIf e.ChangedButton = m_HighlightBtn Then Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT) + Map.refProjectVM.SelProdProj = ProdProj.NULL End If End If 'If e.ChangedButton = Input.MouseButton.Left Then diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb index 161e2aad..54c94e11 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb @@ -369,7 +369,11 @@ Public Class MyMachGroupVM Dim sCurrMachGroupName As String = "" EgtGetMachGroupName(nCurrMachGroup, sCurrMachGroupName) ' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione - EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId) + If Not IsNothing(Map.refProdManagerVM) Then + EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId) + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refOnlyProdManagerVM.CurrProd.nProdId) + End If EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, sMATERIAL) EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup) ' scrivo dati costruzione grezzo in gruppo di lavorazione diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb index 31cd2d83..f101918f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb @@ -316,7 +316,7 @@ Public Class OnlyProdManagerVM If Not m_bOpenProj Then Return m_bOpenProj = False Select Case Map.refMainMenuVM.SelPage - Case Pages.MACHINING + Case Pages.MACHINING OrElse Pages.ONLYPRODPAGE ' recupero progetto da Id Dim DbProject As ProdFileM DbProject = DbControllers.m_ProdController.FindCoreByProdId(m_nProjIdToOpen) @@ -349,6 +349,94 @@ Public Class OnlyProdManagerVM m_nProjIdToOpen = GDB_ID.NULL End Sub + Private Sub InitProd() + ' inizializzo nuovo progetto PROD + Dim nProdId As Integer = 0 + Dim sProdDir As String = "" + InitNewProjectPROD(m_CurrProj.nProjId, nProdId, sProdDir) + ' setto il PType del Prod + DbControllers.m_ProdController.UpdatePType(nProdId, CurrProj.nType) + ' setto la Macchina associata al Prod + DbControllers.m_ProdController.UpdateMachine(nProdId, CurrProj.sMachine) + ' copio file progetto + Dim sProjPath As String = String.Empty + Dim bOk = False + Dim sProdPath As String = sProdDir & "\" & nProdId.ToString("0000") & ".nge" + If EgtGetCurrFilePath(sProjPath) AndAlso Not String.IsNullOrEmpty(sProjPath) Then + Try + File.Copy(sProjPath, sProdPath) + 'Map.refSceneHostVM.MainController.OpenProject(sProdPath) + bOk = True + Catch ex As Exception + EgtOutLog("Impossibile copiare il file") + bOk = False + End Try + End If + If bOk Then + ' aggiorno path proj + Map.refOnlyProdManagerVM.UpdateCurrProj() + ' imposto currprod + Map.refOnlyProdManagerVM.SetCurrProd(nProdId) + ' imposto TempCurrProd + Map.refOnlyProdManagerVM.TempCurrProd = Map.refOnlyProdManagerVM.CurrProd + ' setto flag nuovo progetto in prod + Map.refOnlyProdManagerVM.CurrProd.bIsNew = True + Else + ' elimino da DB + DbControllers.m_ProdController.DeleteProd(nProdId, True) + End If + End Sub + + Private Sub ManageImportLog(nProjId As Integer, sProjDir As String) + Dim LogFile As New List(Of String) + Using FileStream As FileStream = New FileStream(Map.refMainWindowVM.MainWindowM.sLogFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) + Dim StreamReader As New StreamReader(FileStream) + Dim Line As String = StreamReader.ReadLine() + While Not StreamReader.EndOfStream + Line = StreamReader.ReadLine() + LogFile.Add(Line) + End While + StreamReader.Close() + End Using + If LogFile.Count > 0 Then + ' recupero ultima occorrenza di import + Dim sLastImport As String = LogFile.LastOrDefault(Function(x) x.Contains("ImportBtl")) + ' verifico linee successive + Dim nLastImportIndex As Integer = -1 + If Not String.IsNullOrWhiteSpace(sLastImport) Then + nLastImportIndex = LogFile.IndexOf(sLastImport) + End If + Dim sImportMessage As String = sLastImport & Environment.NewLine + Dim sImportLog As New List(Of String)({sLastImport}) + If nLastImportIndex > 0 Then + Dim bGlobalError As Boolean = False + ' ciclo sulle righe successive + For Index = nLastImportIndex + 1 To LogFile.Count - 1 + Dim sLogLine As String = LogFile(Index).Trim() + ' verifico se fanno parte dell'import + Dim bStartWithError As Boolean = sLogLine.StartsWith("Error") + Dim bStartWithInfo As Boolean = sLogLine.StartsWith("Info") + If Not bStartWithError And Not bStartWithInfo Then Exit For + If bStartWithError Then + If Not bGlobalError Then bGlobalError = True + sImportMessage &= sLogLine & Environment.NewLine + End If + sImportLog.Add(sLogLine) + Next + ' salvo file ImportLog nel progetto + Try + File.WriteAllLines(sProjDir & "\" & nProjId.ToString("0000") & "-ImportLog.txt", sImportLog) + Catch ex As Exception + ' + End Try + ' se almeno un errore, mostro log + If bGlobalError Then + MessageBox.Show(Application.Current.MainWindow, sImportMessage, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error + End If + End If + End If + End Sub + #End Region ' Methods #Region "COMMANDS" @@ -423,42 +511,8 @@ Public Class OnlyProdManagerVM SetCurrProj(nProjId) End If Map.refProjectVM.SetOptimizePanel_Visibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO)) - ' inizializzo nuovo progetto PROD - Dim nProdId As Integer = 0 - Dim sProdDir As String = "" - InitNewProjectPROD(m_CurrProj.nProjId, nProdId, sProdDir) - ' setto il PType del Prod - DbControllers.m_ProdController.UpdatePType(nProdId, CurrProj.nType) - ' setto la Macchina associata al Prod - DbControllers.m_ProdController.UpdateMachine(nProdId, CurrProj.sMachine) - ' copio file progetto - Dim sProjPath As String = String.Empty - Dim bOk = False - Dim sProdPath As String = sProdDir & "\" & nProdId.ToString("0000") & ".nge" - If EgtGetCurrFilePath(sProjPath) AndAlso Not String.IsNullOrEmpty(sProjPath) Then - Try - File.Copy(sProjPath, sProdPath) - 'Map.refSceneHostVM.MainController.OpenProject(sProdPath) - bOk = True - Catch ex As Exception - EgtOutLog("Impossibile copiare il file") - bOk = False - End Try - End If - If bOk Then - ' aggiorno path proj - Map.refOnlyProdManagerVM.UpdateCurrProj() - ' imposto currprod - Map.refOnlyProdManagerVM.SetCurrProd(nProdId) - ' imposto TempCurrProd - Map.refOnlyProdManagerVM.TempCurrProd = Map.refOnlyProdManagerVM.CurrProd - ' setto flag nuovo progetto in prod - Map.refOnlyProdManagerVM.CurrProd.bIsNew = True - Else - ' elimino da DB - DbControllers.m_ProdController.DeleteProd(nProdId, True) - End If + InitProd() Else MessageBox.Show(EgtMsg(61876)) End If @@ -781,6 +835,8 @@ Public Class OnlyProdManagerVM ' CheckMe impostata come cancellazione FISICA dal DB... DbControllers.m_ProjController.DeleteProj(nProjId, False) End If + ' inizializzo nuovo progetto PROD + InitProd() ' carico filtri di ricerca Map.refProjectVM.BTLStructureVM.LoadFilters() ' gestisco log di importazione @@ -790,56 +846,6 @@ Public Class OnlyProdManagerVM LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTBTL) End Sub - Private Sub ManageImportLog(nProjId As Integer, sProjDir As String) - Dim LogFile As New List(Of String) - Using FileStream As FileStream = New FileStream(Map.refMainWindowVM.MainWindowM.sLogFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) - Dim StreamReader As New StreamReader(FileStream) - Dim Line As String = StreamReader.ReadLine() - While Not StreamReader.EndOfStream - Line = StreamReader.ReadLine() - LogFile.Add(Line) - End While - StreamReader.Close() - End Using - If LogFile.Count > 0 Then - ' recupero ultima occorrenza di import - Dim sLastImport As String = LogFile.LastOrDefault(Function(x) x.Contains("ImportBtl")) - ' verifico linee successive - Dim nLastImportIndex As Integer = -1 - If Not String.IsNullOrWhiteSpace(sLastImport) Then - nLastImportIndex = LogFile.IndexOf(sLastImport) - End If - Dim sImportMessage As String = sLastImport & Environment.NewLine - Dim sImportLog As New List(Of String)({sLastImport}) - If nLastImportIndex > 0 Then - Dim bGlobalError As Boolean = False - ' ciclo sulle righe successive - For Index = nLastImportIndex + 1 To LogFile.Count - 1 - Dim sLogLine As String = LogFile(Index).Trim() - ' verifico se fanno parte dell'import - Dim bStartWithError As Boolean = sLogLine.StartsWith("Error") - Dim bStartWithInfo As Boolean = sLogLine.StartsWith("Info") - If Not bStartWithError And Not bStartWithInfo Then Exit For - If bStartWithError Then - If Not bGlobalError Then bGlobalError = True - sImportMessage &= sLogLine & Environment.NewLine - End If - sImportLog.Add(sLogLine) - Next - ' salvo file ImportLog nel progetto - Try - File.WriteAllLines(sProjDir & "\" & nProjId.ToString("0000") & "-ImportLog.txt", sImportLog) - Catch ex As Exception - ' - End Try - ' se almeno un errore, mostro log - If bGlobalError Then - MessageBox.Show(Application.Current.MainWindow, sImportMessage, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error - End If - End If - End If - End Sub - #End Region ' ImportBTL #Region "UpdateBTL" @@ -1658,7 +1664,11 @@ Public Class OnlyProdManagerVM nDuploId = EgtGetNext(nDuploId) End While ' resetto CurrProd per evitare di leggere valori produzione dal Db di quel progetto - Map.refProdManagerVM.CurrProd = Nothing + If Not IsNothing(Map.refProdManagerVM) Then + Map.refProdManagerVM.CurrProd = Nothing + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.CurrProd = Nothing + End If ' carico Machgroup che non verrebbero altrimenti importati Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList())) If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then @@ -1737,7 +1747,11 @@ Public Class OnlyProdManagerVM OpenProject(CurrProd) ' Da controllare End If ' ripristino eventuale CurrProd precedente - Map.refProdManagerVM.CurrProd = CurrProd + If Not IsNothing(Map.refProdManagerVM) Then + Map.refProdManagerVM.CurrProd = CurrProd + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.CurrProd = CurrProd + End If WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, Path.GetDirectoryName(ImportDlg.FileName)) LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT) End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml index f48ca579..358e16d2 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml @@ -76,6 +76,7 @@ + diff --git a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectVM.vb b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectVM.vb index 53e5fcf0..084ceb91 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectVM.vb @@ -421,9 +421,9 @@ Public Class ProjectVM Map.refMainMenuVM.SetMainMenuIsEnabled(bIsEnabled) Map.refPartManagerVM.SetPartManagerIsEnabled(bIsEnabled) Map.refLeftPanelVM.SetLeftPanelIsEnabled(bIsEnabled) - Map.refProjManagerVM.SetProjManagerIsEnabled(bIsEnabled) - Map.refProdManagerVM.SetProdManagerIsEnabled(bIsEnabled) - Map.refTopPanelVM.SetTopPanelIsEnabled(bIsEnabled) + If Not IsNothing(Map.refProjManagerVM) Then Map.refProjManagerVM.SetProjManagerIsEnabled(bIsEnabled) + If Not IsNothing(Map.refProdManagerVM) Then Map.refProdManagerVM.SetProdManagerIsEnabled(bIsEnabled) + If Not IsNothing(Map.refTopPanelVM) Then Map.refTopPanelVM.SetTopPanelIsEnabled(bIsEnabled) Map.refOptimizePanelVM.SetOptimizePanelIsEnabled(bIsEnabled) Map.refFeatureManagerVM.SetFeatureManagerIsEnabled(bIsEnabled) End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb index 22adf72d..a60bcc93 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb @@ -2,6 +2,7 @@ Imports EgtBEAMWALL.Core Imports EgtUILib Imports EgtWPFLib5 +Imports Org.BouncyCastle.Crypto.Engines Public Class ProdFileVM Inherits Core.ProdFileVM @@ -142,7 +143,11 @@ Public Class ProdFileVM Select Case VerifyResult Case MessageBoxResult.Yes ' salvo proj - Map.refProdManagerVM.Save() + If Not IsNothing(Map.refProdManagerVM) Then + Map.refProdManagerVM.Save() + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.Save() + End If Case MessageBoxResult.Cancel Return MessageBoxResult.Cancel Case Else ' No @@ -162,14 +167,21 @@ Public Class ProdFileVM Map.refOnlyProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames)) End If DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId, False) - If CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId OrElse CurrProject.nProdId = Map.refOnlyProdManagerVM.CurrProj.nProdId Then + If Not IsNothing(Map.refProjManagerVM) AndAlso CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId Then ' reset prod in path proj Map.refProjManagerVM.UpdateCurrProj() + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso CurrProject.nProdId = Map.refOnlyProdManagerVM.CurrProj.nProdId Then + ' reset prod in path proj + Map.refOnlyProdManagerVM.UpdateCurrProj() End If - Map.refProdManagerVM.CurrProd = Nothing - EgtResetModified() - Return MessageBoxResult.No + If Not IsNothing(Map.refProdManagerVM) Then + Map.refProdManagerVM.CurrProd = Nothing + 'ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + ' Map.refOnlyProdManagerVM.CurrProd = Nothing End If + EgtResetModified() + Return MessageBoxResult.No + End If End Select Else EgtResetModified() diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProjFileVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProjFileVM.vb index 68cc9840..ddf43503 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProjFileVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProjFileVM.vb @@ -128,7 +128,11 @@ Public Class ProjFileVM Select Case MessageBox.Show(EgtMsg(61875), "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) Case MessageBoxResult.Yes ' salvo proj - Map.refProjManagerVM.Save() + If Not IsNothing(Map.refProjManagerVM) Then + Map.refProjManagerVM.Save() + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.Save() + End If Map.refCALCPanelVM.IsMachineApplied = False Case MessageBoxResult.Cancel Return False @@ -141,12 +145,21 @@ Public Class ProjFileVM If Directory.Exists(sProjectDirPath) Then Directory.Delete(sProjectDirPath, True) End If - Map.refProjManagerVM.m_MruFiles.Remove(CurrProject.sProjPath) - Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames)) + If Not IsNothing(Map.refProjManagerVM) Then + Map.refProjManagerVM.m_MruFiles.Remove(CurrProject.sProjPath) + Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames)) + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.m_MruFiles.Remove(CurrProject.sProjPath) + Map.refOnlyProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames)) + End If - ' CheckMe impostata come cancellazione FISICA dal DB... - DbControllers.m_ProjController.DeleteProj(CurrProject.nProjId, False) - Map.refProjManagerVM.CurrProj = Nothing + ' CheckMe impostata come cancellazione FISICA dal DB... + DbControllers.m_ProjController.DeleteProj(CurrProject.nProjId, False) + If Not IsNothing(Map.refProjManagerVM) Then + Map.refProjManagerVM.CurrProj = Nothing + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.CurrProj = Nothing + End If EgtResetModified() Return True End If diff --git a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb index 8ac7c03e..d50a1007 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb @@ -290,7 +290,7 @@ Public Class MySceneHostVM Case Pages.VIEW If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then If Map.refFreeContourManagerVM.bIsActive AndAlso - ( Map.refFreeContourManagerVM.SelType = FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES Or + (Map.refFreeContourManagerVM.SelType = FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES Or Map.refFreeContourManagerVM.bIsOpeningCurveCompo) Then ' passo entità selezionata Map.refFreeContourManagerVM.OnMouseSelectedObj(EgtGetFirstSelectedObj(), True) @@ -572,8 +572,8 @@ Public Class MySceneHostVM Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.CurrProj.sMachine)) ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd), - Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.CurrProd.sMachine), - Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine)) + Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.TempCurrProd.sMachine), + Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.CurrProd.sMachine)) End If SectionXMaterial.SetType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) Core.ViewPanelVM.UpdateBWType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) @@ -592,13 +592,13 @@ Public Class MySceneHostVM ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) Then 'Map.refFullCompleteManagerVM.CurrProd = Map.refFullCompleteManagerVM.TempCurrProd CurrProd = Map.refOnlyProdManagerVM.TempCurrProd - End If - 'DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) - DbControllers.m_ProdController.LockByProdId(CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) - ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel - Map.refCALCPanelVM.LoadMachineList() End If - If Map.refMainMenuVM.SelPage = Pages.VIEW Then + 'DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + DbControllers.m_ProdController.LockByProdId(CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel + Map.refCALCPanelVM.LoadMachineList() + End If + If Map.refMainMenuVM.SelPage = Pages.VIEW Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROJ, 3, EgtMsg(63006), 70, 100) ' Loading graphics ' mostro tutti i pezzi Map.refShowBeamPanelVM.ShowAll(True) @@ -703,7 +703,7 @@ Public Class MySceneHostVM Private Sub OnImportingProject(sender As Object, nType As Integer, ByRef nFlag As Integer) If nType = FT.BTL Or nType = FT.BTLX Then Dim sBTLFlag As String - If Map.refProjManagerVM.nProjType = Core.ConstBeam.BWType.BEAM Then + If Not IsNothing(Map.refProjManagerVM) AndAlso Map.refProjManagerVM.nProjType = Core.ConstBeam.BWType.BEAM OrElse Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Map.refOnlyProdManagerVM.nProjType = Core.ConstBeam.BWType.BEAM Then sBTLFlag = K_BTLFLAG Else sBTLFlag = K_WALLBTLFLAG @@ -723,7 +723,11 @@ Public Class MySceneHostVM Dim nPartId As Integer = EgtGetFirstPart() While nPartId <> GDB_ID.NULL ' scrivo in ogni pezzo ProjId - EgtSetInfo(nPartId, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) + If Not IsNothing(Map.refProjManagerVM) Then + EgtSetInfo(nPartId, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + EgtSetInfo(nPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.nLoadingProjId) + End If nPartId = EgtGetNextPart(nPartId) ' scrivo Id negli outline Dim nPRId As Integer = 1 @@ -742,21 +746,29 @@ Public Class MySceneHostVM End While ' scrivo info proj e type su layer BtlInfo Dim nBTLInfoLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) - EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) - If Not IsNothing(Map.refProjManagerVM.CurrProj) Then + If Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) Then + EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refProjManagerVM.CurrProj.nType) - Else + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) Then + EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.nLoadingProjId) EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refOnlyProdManagerVM.CurrProd.nType) End If ' scrivo info proj su layer AsseBase Dim nAsseBaseLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) + If Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) Then EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) - Else - Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) Then + EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.nLoadingProjId) + End If + Else + Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error - Map.refProjManagerVM.NewProject() + If Not IsNothing(Map.refProjManagerVM) Then + Map.refProjManagerVM.NewProject() + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.NewProject() + End If End If - MainScene.SetStatusNull() End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/LuaExec.vb b/EgtBEAMWALL.ViewerOptimizer/Utility/LuaExec.vb index a8e3328c..9ed55b5a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/LuaExec.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/LuaExec.vb @@ -118,7 +118,11 @@ Module LuaExec EgtLuaSetGlobNumVar("NEST.CORNER", nNestCorner) EgtLuaSetGlobStringVar("NEST.MATERIAL", PartList(0).sMATERIAL) EgtLuaSetGlobNumVar("NEST.TIME", nNestTime) - EgtLuaSetGlobNumVar("NEST.PRODID", Map.refProdManagerVM.CurrProd.nProdId) + If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) Then + EgtLuaSetGlobNumVar("NEST.PRODID", Map.refProdManagerVM.CurrProd.nProdId) + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then + EgtLuaSetGlobNumVar("NEST.PRODID", Map.refOnlyProdManagerVM.CurrProd.nProdId) + End If EgtLuaCreateGlobTable("PART") For PartIndex = 0 To PartList.Count - 1 EgtLuaSetGlobIntVar("PART." & PartList(PartIndex).nPartId.ToString(), PartList(PartIndex).m_nCNT + PartList(PartIndex).m_nADDED - PartList(PartIndex).nINPROD) From 2c3e3f74f97d3c343e35c791096a93e1c1e25e0c Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Mon, 6 Nov 2023 16:48:49 +0100 Subject: [PATCH 020/126] Modifica pagina onlyprod --- .../MainMenu/MainMenuVM.vb | 12 ++----- .../OnlyProdManager/OnlyProdManagerVM.vb | 8 +++-- .../OnlyProdProject/OnlyProdProjectV.xaml | 32 +++++++++---------- .../ShowBeamPanel/ShowBeamPanelVM.vb | 2 +- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb index 8e39ae00..5f8b2911 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb @@ -64,13 +64,7 @@ Public Class MainMenuVM Return m_SelPage = Pages.ONLYPRODPAGE End Get Set(value As Boolean) - If value Then - If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso - Map.refProjManagerVM.CurrProj.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then - Map.refProdManagerVM.CurrProd.SetReloadProject(False) - End If - SelPage = Pages.ONLYPRODPAGE - End If + If value Then SelPage = Pages.ONLYPRODPAGE End Set End Property @@ -541,7 +535,7 @@ Public Class MainMenuVM If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType) - Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM) + If Not IsNothing(Map.refTopPanelVM) Then Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM) Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) Else Map.refRawPartListVM.UpdateColumns(BWType.BEAM) @@ -695,7 +689,7 @@ Public Class MainMenuVM Private Function ExitONLYPRODPAGE(bVerifyModification As Boolean) As Boolean ' verifico se progetto modificato, e chiedo se salvare If bVerifyModification Then - If ProdFileVM.VerifyProjectModification(Map.refProdManagerVM.CurrProd) = MessageBoxResult.Cancel Then + If ProdFileVM.VerifyProjectModification(Map.refOnlyProdManagerVM.CurrProd) = MessageBoxResult.Cancel Then Return False End If End If diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb index f101918f..039ff8f9 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb @@ -657,7 +657,7 @@ Public Class OnlyProdManagerVM DbControllers.m_ProjController.UpdateMachine(ProjId, Map.refCALCPanelVM.SelectedMachine.Name) ' se uno dei Proj interessati equivale al Proj correntemente aperto setto la Macchina dello stesso ' (poichè il progetto corrente non viene riaperto e riletto dal DB) - If ProjId = Map.refProjManagerVM.CurrProj.nProjId Then Map.refProjManagerVM.CurrProj.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name) + If ProjId = Map.refOnlyProdManagerVM.CurrProj.nProjId Then Map.refOnlyProdManagerVM.CurrProj.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name) Next Map.refCALCPanelVM.ResetMachineModified() End If @@ -1675,7 +1675,11 @@ Public Class OnlyProdManagerVM ' inizializzo nuovo progetto PROD Dim nProdId As Integer = 0 Dim sProdDir As String = "" - Map.refProdManagerVM.InitNewProject(NewProjIdList(0), nProdId, sProdDir) + If Not IsNothing(Map.refProdManagerVM) Then + Map.refProdManagerVM.InitNewProject(NewProjIdList(0), nProdId, sProdDir) + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then + Map.refOnlyProdManagerVM.InitNewProjectPROD(NewProjIdList(0), nProdId, sProdDir) + End If ' setto il PType del Prod DbControllers.m_ProdController.UpdatePType(nProdId, nType) ' setto la Macchina associata al Prod diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml index 358e16d2..9a3d392e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml @@ -102,31 +102,31 @@ diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb index 33995a19..e14b5d43 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb @@ -176,7 +176,7 @@ Public Class ShowBeamPanelVM ' deseleziono tutto Map.refProjectVM.BTLStructureVM.SelBTLParts.Clear() ' se attivata opzione, li assemblo - Map.refProjectVM.BTLStructureVM.ShowBuilding(If(Map.refMainMenuVM.SelPage = Pages.VIEW, ShowBuilding_IsChecked, False), False) + Map.refProjectVM.BTLStructureVM.ShowBuilding(If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, ShowBuilding_IsChecked, False), False) If bDraw Then EgtDraw() End Sub From 293f007f2e9dc726f09c215c52acd4dbadd71b2e Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 8 Nov 2023 09:08:28 +0100 Subject: [PATCH 021/126] aggiornato metodo per la visualizzazione della preview del PDF --- EgtBEAMWALL.ViewerOptimizer/App.config | 11 +- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 127 +- .../PdfViewer/PDFViewerVM.vb | 102 ++ .../PdfViewer/PdfViewer.xaml | 9 + .../PdfViewer/PdfViewer.xaml.vb | 136 +++ .../Statistics/PDFEditorV.xaml | 7 +- .../Statistics/PDFEditorVM.vb | 86 +- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 1046 +++++++++++++++++ .../NuGetUpgradeLog.html | 182 +++ .../packages.config | 6 +- 10 files changed, 1575 insertions(+), 137 deletions(-) create mode 100644 EgtBEAMWALL.ViewerOptimizer/PdfViewer/PDFViewerVM.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml.vb create mode 100644 MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj create mode 100644 MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/NuGetUpgradeLog.html rename {EgtBEAMWALL.ViewerOptimizer => MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer}/packages.config (76%) diff --git a/EgtBEAMWALL.ViewerOptimizer/App.config b/EgtBEAMWALL.ViewerOptimizer/App.config index e687c601..4c05c6cd 100644 --- a/EgtBEAMWALL.ViewerOptimizer/App.config +++ b/EgtBEAMWALL.ViewerOptimizer/App.config @@ -1,16 +1,13 @@  - +
- - - - + @@ -49,6 +46,10 @@ + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index 0f96b795..0d63746f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -1,5 +1,4 @@  - Debug @@ -138,12 +137,6 @@ MinimumRecommendedRules.ruleset - - ..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll - - - ..\packages\DotNetZip.1.16.0\lib\net40\DotNetZip.dll - False ..\ExtLibs\EgtUILib.dll @@ -152,55 +145,7 @@ False ..\ExtLibs\EgtWPFLib5.dll - - ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll - - - ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll - - - ..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll - - - ..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll - - - ..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll - - - ..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll - - - ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\MigraDoc.DocumentObjectModel-wpf.dll - - - ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\MigraDoc.Rendering-wpf.dll - - - ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\MigraDoc.RtfRendering-wpf.dll - - - ..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll - - - ..\packages\MySql.Data.EntityFramework.8.0.21\lib\net452\MySql.Data.EntityFramework.dll - - - ..\packages\NLog.5.0.1\lib\net46\NLog.dll - - - ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\PdfSharp-wpf.dll - - - ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\PdfSharp.Charting-wpf.dll - - - ..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - @@ -209,24 +154,9 @@ - - ..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll - - - ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll - @@ -237,16 +167,10 @@ 4.0 - - ..\packages\MySql.Data.8.0.21\lib\net452\Ubiety.Dns.Core.dll - - - ..\packages\MySql.Data.8.0.21\lib\net452\Zstandard.Net.dll - @@ -328,6 +252,9 @@ + + PdfViewer.xaml + ProjectTypeWndV.xaml @@ -540,6 +467,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -786,7 +717,6 @@ SettingsSingleFileGenerator Settings.Designer.vb - @@ -1020,6 +950,41 @@ + + + 1.8.5 + + + 1.16.0 + + + 6.4.4 + + + 3.21.9 + + + 1.3.5 + + + 10.0.22621.2428 + + + 8.0.21 + + + 5.0.1 + + + 1.50.5147 + + + 1.9.0 + + + 6.0.0 + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe @@ -1027,12 +992,4 @@ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPa IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR64.exe IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerD64.exe - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PDFViewerVM.vb b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PDFViewerVM.vb new file mode 100644 index 00000000..bc4976fc --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PDFViewerVM.vb @@ -0,0 +1,102 @@ +Imports System.Threading.Tasks +Imports EgtWPFLib5 +Imports Windows.Storage +Imports System.IO +Imports Windows.Data.Pdf +Imports Windows.Storage.Streams + +Public Class PDFViewerVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + Private m_sPdfPath As String + Public Property PdfPath As String + Get + Return m_sPdfPath + End Get + Set(value As String) + m_sPdfPath = value + If Not String.IsNullOrEmpty(m_sPdfPath) Then + Dim path = System.IO.Path.GetFullPath(m_sPdfPath) + StorageFile.GetFileFromPathAsync(path).AsTask().ContinueWith(Function(t) PdfDocument.LoadFromFileAsync(t.Result).AsTask()).Unwrap().ContinueWith(Function(t2) PdfToImages(t2.Result), TaskScheduler.FromCurrentSynchronizationContext()) + End If + NotifyPropertyChanged(NameOf(PdfPath)) + End Set + End Property + + Private Shared m_Items As List(Of Image) + Public Shared ReadOnly Property Items As List(Of Image) + Get + Return m_Items + End Get + End Property + + 'Public Shared ReadOnly PdfPathProperty As DependencyProperty = DependencyProperty.Register("PdfPath", + ' GetType(String), + ' GetType(PDFViewerVM)) + + 'Private Shared Sub OnPdfPathChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs) + ' 'Dim pdfDrawer As PdfViewer = CType(d, PdfViewer) + + ' If Not String.IsNullOrEmpty(PdfPath) Then + ' Dim path = System.IO.Path.GetFullPath(PdfPath) + ' StorageFile.GetFileFromPathAsync(path).AsTask().ContinueWith(Function(t) PdfDocument.LoadFromFileAsync(t.Result).AsTask()).Unwrap().ContinueWith(Function(t2) PdfToImages(pdfDrawer, t2.Result), TaskScheduler.FromCurrentSynchronizationContext()) + ' End If + 'End Sub + +#End Region ' Field & Properties + + Sub New() + End Sub + +#Region "METHODS" + + ''' + ''' Funzione che trasforma le pagine del pdf in immagine + ''' + ''' PDF da trasformare + ''' Singola pagina del PDf + ''' + Private Shared Async Function PdfToImages(pdfDoc As PdfDocument) As Task + 'Dim items As ItemCollection = pdfViewer.PagesContainer.Items + Items.Clear() + + If IsNothing(pdfDoc) Then Return + + For i As Integer = 0 To pdfDoc.PageCount - 1 + Using page As PdfPage = pdfDoc.GetPage(i) + Dim bitmap As BitmapImage = Await PageToBitmapAsync(page) + Dim image As New Image With { + .Source = bitmap, + .HorizontalAlignment = HorizontalAlignment.Center, + .Width = bitmap.Width, + .Height = bitmap.Height + } + Items.Add(image) + End Using + Next + End Function + + ''' + ''' Funzione che trasforma la singola pagina del PDF in bitmap + ''' + ''' Singola pagina del PDF che verrà trasformata in bitmap + ''' + Private Shared Async Function PageToBitmapAsync(page As PdfPage) As Task(Of BitmapImage) + Dim image As New BitmapImage() + + Using stream = New InMemoryRandomAccessStream() + Await page.RenderToStreamAsync(stream) + image.BeginInit() + image.CacheOption = BitmapCacheOption.OnLoad + image.StreamSource = stream.AsStream() + image.EndInit() + End Using + + Return image + End Function + +#End Region ' Methods + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml new file mode 100644 index 00000000..51d5669a --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml @@ -0,0 +1,9 @@ + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml.vb new file mode 100644 index 00000000..dbcf0227 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml.vb @@ -0,0 +1,136 @@ +Imports System.IO +Imports System.Threading.Tasks +Imports Windows.Data.Pdf +Imports Windows.Storage +Imports Windows.Storage.Streams + +Partial Public Class PdfViewer + Inherits UserControl + + 'Public Property PdfPath As String + ' Get + ' Return CStr(GetValue(PdfPathProperty)) + ' End Get + ' Set(value As String) + ' SetValue(PdfPathProperty, value) + ' End Set + 'End Property + + 'Private Shared m_Items As New List(Of Image) + 'Public Shared ReadOnly Property Items As List(Of Image) + ' Get + ' Return m_Items + ' End Get + 'End Property + + Public Property PdfPath As String + Get + Return CStr(GetValue(PdfPathProperty)) + End Get + Set(value As String) + SetValue(PdfPathProperty, value) + End Set + End Property + + 'Public Shared ReadOnly PdfPathProperty As DependencyProperty = DependencyProperty.Register("PdfPath", + ' GetType(String), + ' GetType(PdfViewer), + ' New FrameworkPropertyMetadata(String.Empty, New PropertyChangedCallback(AddressOf OnPdfPathChanged))) + + Public Shared ReadOnly PdfPathProperty As DependencyProperty = DependencyProperty.Register("PdfPath", + GetType(String), + GetType(PdfViewer), + New PropertyMetadata(Nothing, propertyChangedCallback:=AddressOf OnPdfPathChanged)) + + Private Shared Sub OnPdfPathChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs) + Dim pdfDrawer As PdfViewer = CType(d, PdfViewer) + + If Not String.IsNullOrEmpty(pdfDrawer.PdfPath) Then + Dim path = System.IO.Path.GetFullPath(pdfDrawer.PdfPath) + StorageFile.GetFileFromPathAsync(path).AsTask().ContinueWith(Function(t) PdfDocument.LoadFromFileAsync(t.Result).AsTask()).Unwrap().ContinueWith(Function(t2) PdfToImages(pdfDrawer, t2.Result), TaskScheduler.FromCurrentSynchronizationContext()) + End If + End Sub + + 'Private Shared Sub OnPdfPathChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs) + ' Dim pdfDrawer As PdfViewer = CType(d, PdfViewer) + ' If Not String.IsNullOrEmpty(pdfDrawer.PdfPath) Then + ' Dim path = System.IO.Path.GetFullPath(pdfDrawer.PdfPath) + ' StorageFile.GetFileFromPathAsync(path).AsTask().ContinueWith(Function(t) PdfDocument.LoadFromFileAsync(t.Result).AsTask()).Unwrap().ContinueWith(Function(t2) PdfToImages(t2.Result), TaskScheduler.FromCurrentSynchronizationContext()) + ' End If + 'End Sub + + Sub New() + InitializeComponent() + End Sub + + '''' + '''' Funzione che trasforma le pagine del pdf in immagine + '''' + '''' Singola pagina del PDf + '''' + 'Private Shared Async Function PdfToImages(pdfDoc As PdfDocument) As Task + ' 'Dim items As ItemCollection = pdfViewer.PagesContainer.Items + ' Items.Clear() + + ' If IsNothing(pdfDoc) Then Return + + ' For i As Integer = 0 To pdfDoc.PageCount - 1 + ' Using page As PdfPage = pdfDoc.GetPage(i) + ' Dim bitmap As BitmapImage = Await PageToBitmapAsync(page) + ' Dim image As New Image With { + ' .Source = bitmap, + ' .HorizontalAlignment = HorizontalAlignment.Center, + ' .Width = bitmap.Width, + ' .Height = bitmap.Height + ' } + ' Items.Add(image) + ' End Using + ' Next + 'End Function + + ''' + ''' Funzione che trasforma le pagine del pdf in immagine + ''' + ''' PDF da trasformare + ''' Singola pagina del PDf + ''' + Private Shared Async Function PdfToImages(pdfViewer As PdfViewer, pdfDoc As PdfDocument) As Task + Dim items As ItemCollection = pdfViewer.PagesContainer.Items + items.Clear() + + If IsNothing(pdfDoc) Then Return + + For i As Integer = 0 To pdfDoc.PageCount - 1 + Using page As PdfPage = pdfDoc.GetPage(i) + Dim bitmap As BitmapImage = Await PageToBitmapAsync(page) + Dim image As New Image With { + .Source = bitmap, + .HorizontalAlignment = HorizontalAlignment.Center, + .Width = bitmap.Width, + .Height = bitmap.Height, + .Margin = New Thickness(5, 20, 5, 20) + } + items.Add(image) + End Using + Next + End Function + + ''' + ''' Funzione che trasforma la singola pagina del PDF in bitmap + ''' + ''' Singola pagina del PDF che verrà trasformata in bitmap + ''' + Private Shared Async Function PageToBitmapAsync(page As PdfPage) As Task(Of BitmapImage) + Dim image As New BitmapImage() + + Using stream = New InMemoryRandomAccessStream() + Await page.RenderToStreamAsync(stream) + image.BeginInit() + image.CacheOption = BitmapCacheOption.OnLoad + image.StreamSource = stream.AsStream() + image.EndInit() + End Using + + Return image + End Function +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml index c5d3c895..281eceb8 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml @@ -28,11 +28,11 @@ Style="{StaticResource PDFPanel_Button}"> - + --> - + + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb index ffb90fe5..9394221a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb @@ -50,7 +50,7 @@ Public Class PDFEditorVM m_ExpanderList.Add(New ExpanderPDF(ListTypes.RAWPART)) ' RawPart List m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_TOT)) ' Part Totals m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART)) ' Part List - m_WebAddress = "about:blank" ' Pagina vuota + m_WebAddress = "" ' Pagina vuota Map.SetRefPDFEditorVM(Me) End Sub @@ -74,7 +74,7 @@ Public Class PDFEditorVM ''' Public Sub CreatePreviewVis() Map.refStatisticsVM.CreatePrintPDF(PDFPage.VIEW, True) - m_WebAddress = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics - Visualization.pdf" + WebAddress = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics - Visualization.pdf" NotifyPropertyChanged(NameOf(WebAddress)) End Sub @@ -96,32 +96,32 @@ Public Class PDFEditorVM ''' Public Sub CreatePreviewOtt() Map.refStatisticsVM.CreatePrintPDF(PDFPage.MACHING, True) - m_WebAddress = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics - Optimizer.pdf" + WebAddress = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics - Optimizer.pdf" NotifyPropertyChanged(NameOf(WebAddress)) End Sub #End Region ' CreatePreviewVis -#Region "ClosePreview" + '#Region "ClosePreview" - Public ReadOnly Property ClosePreview_Command As ICommand - Get - If m_cmdClosePreview Is Nothing Then - m_cmdClosePreview = New Command(AddressOf ClosePreview) - End If - Return m_cmdClosePreview - End Get - End Property + ' Public ReadOnly Property ClosePreview_Command As ICommand + ' Get + ' If m_cmdClosePreview Is Nothing Then + ' m_cmdClosePreview = New Command(AddressOf ClosePreview) + ' End If + ' Return m_cmdClosePreview + ' End Get + ' End Property - ''' - ''' Funzione per la chiusura della preview - ''' - Public Sub ClosePreview() - m_WebAddress = "about:blank" - NotifyPropertyChanged(NameOf(WebAddress)) - End Sub + ' ''' + ' ''' Funzione per la chiusura della preview + ' ''' + ' Public Sub ClosePreview() + ' m_WebAddress = "" + ' NotifyPropertyChanged(NameOf(WebAddress)) + ' End Sub -#End Region ' CreatePreviewVis + '#End Region ' CreatePreviewVis #End Region ' Commands @@ -385,33 +385,33 @@ End Class ' Classe gestione binding Web browser -Public Class WebBrowserUtility +'Public Class WebBrowserUtility - Public Shared ReadOnly BindableSourceProperty As DependencyProperty = DependencyProperty.RegisterAttached("BindableSource", - GetType(String), - GetType(WebBrowserUtility), - New UIPropertyMetadata(Nothing, AddressOf BindableSourcePropertyChanged)) +' Public Shared ReadOnly BindableSourceProperty As DependencyProperty = DependencyProperty.RegisterAttached("BindableSource", +' GetType(String), +' GetType(WebBrowserUtility), +' New UIPropertyMetadata(Nothing, AddressOf BindableSourcePropertyChanged)) - Public Shared Function GetBindableSource(obj As DependencyObject) As String - Return DirectCast(obj.GetValue(BindableSourceProperty), String) - End Function +' Public Shared Function GetBindableSource(obj As DependencyObject) As String +' Return DirectCast(obj.GetValue(BindableSourceProperty), String) +' End Function - Public Shared Sub SetBindableSource(obj As DependencyObject, value As String) - obj.SetValue(BindableSourceProperty, value) - End Sub +' Public Shared Sub SetBindableSource(obj As DependencyObject, value As String) +' obj.SetValue(BindableSourceProperty, value) +' End Sub - Public Shared Sub BindableSourcePropertyChanged(o As DependencyObject, e As DependencyPropertyChangedEventArgs) - Dim browser As WebBrowser = TryCast(o, WebBrowser) - If Not IsNothing(browser) Then - Dim uri As String = TryCast(e.NewValue, String) - If Not IsNothing(uri) Then - browser.Source = New Uri(uri) - Else - browser.Source = Nothing - End If - End If - End Sub -End Class +' Public Shared Sub BindableSourcePropertyChanged(o As DependencyObject, e As DependencyPropertyChangedEventArgs) +' Dim browser As WebBrowser = TryCast(o, WebBrowser) +' If Not IsNothing(browser) Then +' Dim uri As String = TryCast(e.NewValue, String) +' If Not IsNothing(uri) Then +' browser.Source = New Uri(uri) +' Else +' browser.Source = Nothing +' End If +' End If +' End Sub +'End Class Class ColumnNameConverter Implements IValueConverter diff --git a/MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj new file mode 100644 index 00000000..3bb3ab3d --- /dev/null +++ b/MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -0,0 +1,1046 @@ + + + + + + Debug + AnyCPU + {57291955-F9C4-4466-8D53-476D43BA3659} + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + WinExe + EgtBEAMWALL.ViewerOptimizer + EgtBEAMWALL.ViewerOptimizer + v4.7.2 + Custom + true + + + + + + AnyCPU + true + full + true + true + true + bin\Debug\ + EgtBEAMWALL.ViewerOptimizer.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + false + + + x86 + pdbonly + false + false + true + false + true + bin\Release\ + EgtBEAMWALL.ViewerOptimizer.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + false + + + On + + + Binary + + + Off + + + On + + + true + true + true + bin\x64\Debug\ + EgtBEAMWALL.ViewerOptimizer.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + full + x64 + MinimumRecommendedRules.ruleset + false + + + true + bin\x64\Release\ + EgtBEAMWALL.ViewerOptimizer.xml + true + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + pdbonly + x64 + MinimumRecommendedRules.ruleset + false + + + true + true + true + bin\x86\Debug\ + EgtBEAMWALL.ViewerOptimizer.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + full + x86 + MinimumRecommendedRules.ruleset + false + + + true + bin\x86\Release\ + EgtBEAMWALL.ViewerOptimizer.xml + true + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + pdbonly + x86 + MinimumRecommendedRules.ruleset + false + + + Resources\EgtBEAMWALL.ico + + + app.manifest + + + true + true + true + bin\RemoteDebug\ + EgtBEAMWALL.ViewerOptimizer.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + full + AnyCPU + + + true + true + true + bin\x64\RemoteDebug\ + EgtBEAMWALL.ViewerOptimizer.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + full + x64 + MinimumRecommendedRules.ruleset + + + true + true + true + bin\x86\RemoteDebug\ + EgtBEAMWALL.ViewerOptimizer.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + full + x86 + MinimumRecommendedRules.ruleset + + + + ..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll + + + ..\packages\DotNetZip.1.16.0\lib\net40\DotNetZip.dll + + + False + ..\ExtLibs\EgtUILib.dll + + + False + ..\ExtLibs\EgtWPFLib5.dll + + + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll + + + ..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll + + + ..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll + + + ..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll + + + ..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll + + + + ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\MigraDoc.DocumentObjectModel-wpf.dll + + + ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\MigraDoc.Rendering-wpf.dll + + + ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\MigraDoc.RtfRendering-wpf.dll + + + ..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll + + + ..\packages\MySql.Data.EntityFramework.8.0.21\lib\net452\MySql.Data.EntityFramework.dll + + + ..\packages\NLog.5.0.1\lib\net46\NLog.dll + + + ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\PdfSharp-wpf.dll + + + ..\packages\PDFsharp-MigraDoc-wpf.1.50.5147\lib\net30\PdfSharp.Charting-wpf.dll + + + ..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll + + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + + + + + + + + + ..\packages\System.IO.Pipelines.6.0.0\lib\net461\System.IO.Pipelines.dll + + + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + + + + + + + + 4.0 + + + ..\packages\MySql.Data.8.0.21\lib\net452\Ubiety.Dns.Core.dll + + + + + + + ..\packages\MySql.Data.8.0.21\lib\net452\Zstandard.Net.dll + + + + + MSBuild:Compile + Designer + + + AboutBoxV.xaml + + + ChangeMaterialWndV.xaml + + + + + + + MovePartInRawPartWndV.xaml + + + + InputPwdWndV.xaml + + + + + MultiCopyRawPartWndV.xaml + + + + AddSectionXMaterialWndV.xaml + + + + BeamMachiningsWindowV.xaml + + + + BlockedWndV.xaml + + + + BTLDataV.xaml + + + + + + + + + + + QParameterListV.xaml + + + QParamListV.xaml + + + + + CalcPanelV.xaml + + + + + FreeContourManagerV.xaml + + + + FreeContourInputV.xaml + + + + + + + NestingRunningWndV.xaml + + + + + ProjectTypeWndV.xaml + + + + + + SetUpV.xaml + + + + StatisticsTimePanelV.xaml + + + + OptimizerStatisticsV.xaml + + + PDFEditorV.xaml + + + + + StatisticsV.xaml + + + + + + + + + + UpdateBTLWndV.xaml + + + + UpdateOrAppendWndV.xaml + + + + + + + + + + + WarehouseWndV.xaml + + + + + MacroFeatureWndV.xaml + + + + AddFeatureWndV.xaml + + + + AddPartWndV.xaml + + + + AddRawPartWndV.xaml + + + + BTLDataWndV.xaml + + + + PartParametersV.xaml + + + + ChangeParameterWndV.xaml + + + + ConfigurationPageV.xaml + + + + MachinePanelV.xaml + + + + + OptimizePanelV.xaml + + + + PartManagerV.xaml + + + + ProdManagerV.xaml + + + + + ProjectV.xaml + + + + ProjManagerV.xaml + + + + + SceneHostV.xaml + + + + + ShowPanelV.xaml + + + StatusBarV.xaml + + + + TopPanelV.xaml + + + + + Dictionary.xaml + + + + + ViewPanelV.xaml + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Application.xaml + Code + + + BottomPanelV.xaml + + + + + + FeatureListV.xaml + + + PParameterListV.xaml + + + PartInRawPartListV.xaml + + + BTLPartListV.xaml + + + RawPartListV.xaml + + + FeatureManagerV.xaml + + + + InstrumentPanelV.xaml + + + + LeftPanelV.xaml + + + + MainMenuV.xaml + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + + + + + + + + + + + + + + + + + + + + MainWindowV.xaml + + + + Code + + + Microsoft.VisualBasic.WPF.MyExtension + 1.0.0.0 + + + True + True + Resources.resx + + + True + Settings.settings + True + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + + + + + SettingsSingleFileGenerator + Settings.Designer.vb + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {f22835a1-83d8-4334-91bb-baaeb9cf59b1} + EgtBEAMWALL.Core + + + {24d7760e-662a-47e4-b729-b70126c24a31} + EgtBEAMWALL.DataLayer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe +IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerD32.exe +IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR64.exe +IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerD64.exe + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + + + \ No newline at end of file diff --git a/MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/NuGetUpgradeLog.html b/MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/NuGetUpgradeLog.html new file mode 100644 index 00000000..ab0ebd12 --- /dev/null +++ b/MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/NuGetUpgradeLog.html @@ -0,0 +1,182 @@ + + + + + NuGetMigrationLog +

+ NuGet Migration Report - EgtBEAMWALL.ViewerOptimizer

Overview

Migration to PackageReference was completed successfully. Please build and run your solution to verify that all packages are available.
+ If you run into any problems, have feedback, questions, or concerns, please + file an issue on the NuGet GitHub repository.
+ Changed files and this report have been backed up here: + C:\EgtDev\egtbeamwall\MigrationBackup\814cbbc9\EgtBEAMWALL.ViewerOptimizer

Packages processed

Top-level dependencies:

Package IdVersion
BouncyCastle + v1.8.5
DotNetZip + v1.16.0
EntityFramework + v6.4.4
Google.Protobuf + v3.21.9
K4os.Compression.LZ4.Streams + v1.3.5
Microsoft.Windows.SDK.Contracts + v10.0.22621.2428
MySql.Data.EntityFramework + v8.0.21
NLog + v5.0.1
PDFsharp-MigraDoc-wpf + v1.50.5147
Portable.BouncyCastle + v1.9.0
System.IO.Pipelines + v6.0.0

Transitive dependencies:

Package IdVersion
K4os.Compression.LZ4 + v1.3.5
K4os.Hash.xxHash + v1.0.8
MySql.Data + v8.0.21
SSH.NET + v2016.1.0
System.Buffers + v4.5.1
System.Memory + v4.5.5
System.Numerics.Vectors + v4.5.0
System.Runtime.CompilerServices.Unsafe + v6.0.0
System.Runtime.InteropServices.WindowsRuntime + v4.3.0
System.Runtime.WindowsRuntime + v4.6.0
System.Runtime.WindowsRuntime.UI.Xaml + v4.6.0
System.Threading.Tasks.Extensions + v4.5.4

Package compatibility issues

Description
+ No issues were found. +
\ No newline at end of file diff --git a/EgtBEAMWALL.ViewerOptimizer/packages.config b/MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/packages.config similarity index 76% rename from EgtBEAMWALL.ViewerOptimizer/packages.config rename to MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/packages.config index 15d0c0be..f06e3ad1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/packages.config +++ b/MigrationBackup/814cbbc9/EgtBEAMWALL.ViewerOptimizer/packages.config @@ -7,6 +7,7 @@ + @@ -14,9 +15,12 @@ - + + + + \ No newline at end of file From 9b34053fdea04af1ce039e940059a3468440ae8c Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 8 Nov 2023 18:19:02 +0100 Subject: [PATCH 022/126] EgtBEAMWALL : - piccole modifiche per gestire process Variant (per ora limitato al code 2). --- EgtBEAMWALL.Core/Constants/ConstIni.vb | 1 + EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb | 3 ++- EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/EgtBEAMWALL.Core/Constants/ConstIni.vb b/EgtBEAMWALL.Core/Constants/ConstIni.vb index 41c71fde..3e15f01c 100644 --- a/EgtBEAMWALL.Core/Constants/ConstIni.vb +++ b/EgtBEAMWALL.Core/Constants/ConstIni.vb @@ -97,6 +97,7 @@ Public Module ConstIni Public Const S_IMPORT As String = "Import" Public Const K_BTLFLAG As String = "BtlFlag" Public Const K_WALLBTLFLAG As String = "WallBtlFlag" + Public Const K_BTLAUXDIR As String = "BtlAuxDir" Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting" 'Public Const S_MACH As String = "Mach" diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index c7980a36..ad18c0b3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -1354,9 +1354,10 @@ Public Class LeftPanelVM Dim sPar As String = String.Empty Dim vParQ() As String = Nothing NewFeat.CalcParamArray(vPar, sPar, vParQ) + If NewFeat.nPRC = 900 Then NewFeat.sDES = "2" ' aggiorno la feature con nuovo valore EgtBeamSetPart(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId) - nNewFeatureId = EgtBeamAddProcess(NewFeat.nSelGRP, NewFeat.nPRC, NewFeat.nSelSIDE, "", + nNewFeatureId = EgtBeamAddProcess(NewFeat.nSelGRP, NewFeat.nPRC, NewFeat.nSelSIDE, NewFeat.sDES, Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId(), New Frame3d(), vPar, sPar, vParQ, GDB_ID.NULL, GDB_ID.NULL) bMacroFlag = False diff --git a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb index bd88b734..e334b0f0 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb @@ -65,6 +65,10 @@ Public Class MySceneHostVM EgtSetCurrentContext(MainScene.GetCtx()) ' inizializzo gestore travi e pareti EgtInitBeamMgr(EIB_FL.TS3_POS + EIB_FL.USEUATTR) + ' imposto direttorio BtlAux per geometrie Variant + Dim sBtlAuxDir As String = "" + GetMainPrivateProfileString(S_IMPORT, K_BTLAUXDIR, "", sBtlAuxDir) + EgtSetBtlAuxDir( sBtlAuxDir) ' inizializzo gestore lavorazioni EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir) ' Seleziono la macchina impostata nel file ini From 5017e96cde8a64d32eff67b6c49f2f9149111b90 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Thu, 9 Nov 2023 08:28:55 +0100 Subject: [PATCH 023/126] - correzioni ProjectManager - correzioni selezione pezzi e machgroup --- .../BTLViewModel/BTLStructureVM.vb | 135 ++++++++++++-- .../ItemParamList/BTLPartListV.xaml.vb | 2 + .../LeftPanel/LeftPanelVM.vb | 4 +- .../LeftPanel/OnlyProdLeftPanelV.xaml | 10 -- .../MachGroupPanel/MyMachGroupPanelVM.vb | 2 + .../MainMenu/MainMenuVM.vb | 2 +- .../MainWindow/MainWindowVM.vb | 6 +- .../OnlyProdManager/OnlyProdManagerVM.vb | 164 +++++++++++------- .../Project/ProjectVM.vb | 23 ++- .../SceneHost/MySceneHostVM.vb | 19 +- 10 files changed, 253 insertions(+), 114 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb index 48f6b7da..af962d09 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb @@ -66,8 +66,12 @@ Public Class BTLStructureVM End Get End Property Friend Sub SetSelectionType(value As SelectionTypes) + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then + ' resetto gruppo di lavorazione corrente + EgtResetCurrMachGroup() + End If m_PrevSelectionType = m_SelectionType - If value = m_SelectionType Then Return + If value = m_SelectionType And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then Return m_SelectionType = value Select Case m_SelectionType Case SelectionTypes.SELECT_ @@ -91,7 +95,7 @@ Public Class BTLStructureVM ' mostro pezzi selezionati Map.refProjectVM.BTLStructureVM.ShowAll(False) ' se attivata opzione, li assemblo - Map.refProjectVM.BTLStructureVM.ShowBuilding(If(Map.refMainMenuVM.SelPage = Pages.VIEW, Map.refShowBeamPanelVM.ShowBuilding_IsChecked, False), False) + Map.refProjectVM.BTLStructureVM.ShowBuilding(If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Map.refShowBeamPanelVM.ShowBuilding_IsChecked, False), False) ' nascondo barra di gestione pezzo Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility)) End Select @@ -149,11 +153,15 @@ Public Class BTLStructureVM End Sub Private Sub SelBTLParts_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs) + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then + ' resetto gruppo di lavorazione corrente + EgtResetCurrMachGroup() + End If If m_bOnlySelectItem Then Return Select Case e.Action Case NotifyCollectionChangedAction.Add If e.NewItems.Count > 0 AndAlso Not IsNothing(e.NewItems(0)) Then - If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso m_SelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso m_SelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + If ((Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso m_SelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING Then SelectBTLPart(e.NewItems(0)) Else ' SelectionTypes.HIGHLIGHT HighlightBTLPart(e.NewItems(0)) @@ -161,14 +169,14 @@ Public Class BTLStructureVM End If Case NotifyCollectionChangedAction.Remove If e.OldItems.Count > 0 AndAlso Not IsNothing(e.OldItems(0)) Then - If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso m_PrevSelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING Then + If ((Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso m_PrevSelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING Then DeselectBTLPart(e.OldItems(0)) Else ' SelectionTypes.HIGHLIGHT DeHighlightBTLPart(e.OldItems(0)) End If End If Case NotifyCollectionChangedAction.Reset - If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso m_PrevSelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING Then + If ((Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso m_PrevSelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING Then If Not IsNothing(m_SelBTLPart) Then DeselectBTLPart(m_SelBTLPart) End If @@ -185,10 +193,10 @@ Public Class BTLStructureVM End Sub Private Sub SelectBTLPart(BtlPart As BTLPartVM) - EgtBeamShowFacesName(False) - EgtBeamShowLoadingSide(False, False) m_SelBTLPart = BtlPart - If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + If Map.refMainMenuVM.SelPage = Pages.VIEW Then + EgtBeamShowFacesName(False) + EgtBeamShowLoadingSide(False, False) Map.refProjectVM.MacroFeature_IsEnabled = True ' se modalità building, la tolgo If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then @@ -210,13 +218,15 @@ Public Class BTLStructureVM 'Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility)) ' deseleziono le feature If Not IsNothing(BtlPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing - ' aggiorno stato selezionato tutto - Map.refShowBeamPanelVM.bShowAll = False - Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) - EgtZoom(ZM.ALL) - ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then - ' resetto gruppo di lavorazione corrente - EgtResetCurrMachGroup() + ' aggiorno stato selezionato tutto + Map.refShowBeamPanelVM.bShowAll = False + Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) + EgtZoom(ZM.ALL) + ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then + ' resetto gruppo di lavorazione corrente + EgtResetCurrMachGroup() + EgtBeamShowFacesName(False) + EgtBeamShowLoadingSide(False, False) ' trovo ed evidenzio MachGroup e Duplo di questo pezzo If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Dim MachGroupList As New List(Of MyMachGroupVM) @@ -241,6 +251,52 @@ Public Class BTLStructureVM SceneSelPartSelection() Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) EgtZoom(ZM.ALL) + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then + ' resetto gruppo di lavorazione corrente + EgtResetCurrMachGroup() + End If + EgtBeamShowFacesName(False) + EgtBeamShowLoadingSide(False, False) + Map.refProjectVM.MacroFeature_IsEnabled = True + ' se modalità building, la tolgo + If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then + ShowBuilding(False, False) + End If + ' seleziono pezzo nella scena + SceneSelPartSelection() + ' seleziono pezzo in Db geometrico + EgtBeamSetPart(BtlPart.nPartId) + EgtBeamShowFacesName(True) + Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM) + Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) + EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight) + ' deseleziono le feature + If Not IsNothing(BtlPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing + ' aggiorno stato selezionato tutto + Map.refShowBeamPanelVM.bShowAll = False + ' trovo ed evidenzio MachGroup e Duplo di questo pezzo + If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then + Dim MachGroupList As New List(Of MyMachGroupVM) + For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList + Dim bFound As Boolean = False + For Each Part As PartVM In Machgroup.PartVMList + If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then + Part.SetSearchFound() + bFound = True + Else + Part.ResetSearchFound() + End If + Next + If bFound Then + Machgroup.SetSearchFound() + Else + Machgroup.ResetSearchFound() + End If + Next + End If + Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) + EgtZoom(ZM.ALL) End If NotifyPropertyChanged(NameOf(SelBTLPart)) End Sub @@ -278,7 +334,7 @@ Public Class BTLStructureVM End While End If ' seleziono pagina BottomPanel - Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL) + If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL) EgtDraw() End Sub Private Sub DeHighlightBTLPart(BtlPart As BTLPartVM, Optional bDraw As Boolean = True) @@ -314,6 +370,10 @@ Public Class BTLStructureVM Return m_SelBTLPart End Get Set(value As BTLPartVM) + If Map.refMainMenuVM.SelPage = Pages.MACHINING Or (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then + ' resetto gruppo di lavorazione corrente + EgtResetCurrMachGroup() + End If If Not IsNothing(m_SelBTLPart) Then ' se necessario tolgo solido dal precedentemente selezionato If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then @@ -345,8 +405,6 @@ Public Class BTLStructureVM Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) EgtZoom(ZM.ALL) ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then - ' resetto gruppo di lavorazione corrente - EgtResetCurrMachGroup() ' trovo ed evidenzio MachGroup e Duplo di questo pezzo If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Dim MachGroupList As New List(Of MyMachGroupVM) @@ -371,6 +429,45 @@ Public Class BTLStructureVM SceneSelPartSelection() Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) EgtZoom(ZM.ALL) + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + ' se modalità building, la tolgo + If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then + ShowBuilding(False, False) + End If + ' seleziono pezzo nella scena + SceneSelPartSelection() + ' seleziono pezzo in Db geometrico + EgtBeamSetPart(m_SelBTLPart.nPartId) + ' seleziono pagina BottomPanel + Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART) + ' mostro barra di gestione pezzo + Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility)) + ' deseleziono le feature + If Not IsNothing(m_SelBTLPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing + ' aggiorno stato selezionato tutto + Map.refShowBeamPanelVM.bShowAll = False + ' trovo ed evidenzio MachGroup e Duplo di questo pezzo + If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then + Dim MachGroupList As New List(Of MyMachGroupVM) + For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList + Dim bFound As Boolean = False + For Each Part As PartVM In Machgroup.PartVMList + If EgtDuploGetOriginal(Part.nPartId) = m_SelBTLPart.nPartId Then + Part.SetSearchFound() + bFound = True + Else + Part.ResetSearchFound() + End If + Next + If bFound Then + Machgroup.SetSearchFound() + Else + Machgroup.ResetSearchFound() + End If + Next + End If + Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) + EgtZoom(ZM.ALL) End If End If NotifyPropertyChanged(NameOf(SelBTLPart)) @@ -1336,7 +1433,7 @@ Public Class BTLStructureVM End Property Public Sub DeletePart() - If Map.refMainMenuVM.SelPage = Pages.VIEW Then Map.refLeftPanelVM.RemovePartCmd() + If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refLeftPanelVM.RemovePartCmd() End Sub #End Region ' DeletePart diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb index 9e6a9191..db68854f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb @@ -85,6 +85,8 @@ Public Class BTLPartListV ' m_MainWindowVM.SetMouseButton("Highlight") 'End If End If + ' imposto tipo di grid selezionata + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.MACHGROUP) End Sub Public Shared Function FindVisualParent(Of T As DependencyObject)(ByVal child As DependencyObject) As T diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index e934198f..04151e11 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -22,12 +22,12 @@ Public Class LeftPanelVM Public ReadOnly Property ViewPage_Visibility As Visibility Get - Return If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) + Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, Visibility.Visible, Visibility.Collapsed) End Get End Property Public ReadOnly Property MachiningPage_Visibility As Visibility Get - Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) + Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING, Visibility.Visible, Visibility.Collapsed) End Get End Property diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml index e256301b..4d4c074c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml @@ -82,70 +82,60 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + --> diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb index e813597d..e057bd71 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb @@ -36,13 +36,28 @@ Public Class ConfigurationPageVM End Get Set(value As Integer) m_SelConfigSubPage = value + If m_SelConfigSubPage = ConfigSubPages.GENERAL Then + m_bGeneral_Visibility = Visibility.Visible + m_bParameterQ_Visibility = Visibility.Collapsed + m_bMachine_Visibility = Visibility.Collapsed + ElseIf m_SelConfigSubPage = ConfigSubPages.QPARAMETERS Then + m_bParameterQ_Visibility = Visibility.Visible + m_bGeneral_Visibility = Visibility.Collapsed + m_bMachine_Visibility = Visibility.Collapsed + ElseIf m_SelConfigSubPage = ConfigSubPages.MACHINE Then + m_bMachine_Visibility = Visibility.Visible + m_bGeneral_Visibility = Visibility.Collapsed + m_bParameterQ_Visibility = Visibility.Collapsed + End If + NotifyPropertyChanged(NameOf(General_Visibility)) + NotifyPropertyChanged(NameOf(ParameterQ_Visibility)) + NotifyPropertyChanged(NameOf(Machine_Visibility)) End Set End Property ' flag modifica parametri Macchina Friend bModifyMachParam As Boolean - Public ReadOnly Property MachinePanelVM As MachinePanelVM Get Return Map.refMachinePanelVM @@ -218,6 +233,39 @@ Public Class ConfigurationPageVM End Set End Property + Private m_bGeneral_Visibility As Visibility = Visibility.Visible + Public Property General_Visibility As Visibility + Get + Return m_bGeneral_Visibility + End Get + Set(value As Visibility) + m_bGeneral_Visibility = value + NotifyPropertyChanged(NameOf(General_Visibility)) + End Set + End Property + + Private m_bParameterQ_Visibility As Visibility = Visibility.Collapsed + Public Property ParameterQ_Visibility As Visibility + Get + Return m_bParameterQ_Visibility + End Get + Set(value As Visibility) + m_bParameterQ_Visibility = value + NotifyPropertyChanged(NameOf(ParameterQ_Visibility)) + End Set + End Property + + Private m_bMachine_Visibility As Visibility = Visibility.Collapsed + Public Property Machine_Visibility As Visibility + Get + Return m_bMachine_Visibility + End Get + Set(value As Visibility) + m_bMachine_Visibility = value + NotifyPropertyChanged(NameOf(Machine_Visibility)) + End Set + End Property + ' Definizione comandi Private m_cmdSave As ICommand Private m_cmdChooseExternalBackupFolderPath As ICommand @@ -357,6 +405,24 @@ Public Class ConfigurationPageVM End Get End Property + Public ReadOnly Property General_Msg As String + Get + Return EgtMsg(62535) + End Get + End Property + + Public ReadOnly Property ParameterQ_Msg As String + Get + Return EgtMsg(62536) + End Get + End Property + + Public ReadOnly Property Machine_Msg As String + Get + Return EgtMsg(62537) + End Get + End Property + #End Region ' Messages #Region "Constructor" diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml new file mode 100644 index 00000000..49cc3924 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Core/ConfigurationPage/ConfigurationPageV.xaml.vb b/EgtBEAMWALL.Core/ConfigurationPage/ConfigurationPageV.xaml.vb new file mode 100644 index 00000000..1d11796c --- /dev/null +++ b/EgtBEAMWALL.Core/ConfigurationPage/ConfigurationPageV.xaml.vb @@ -0,0 +1,3 @@ +Public Class ConfigurationPageV + +End Class \ No newline at end of file diff --git a/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml new file mode 100644 index 00000000..cb1967d0 --- /dev/null +++ b/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml.vb b/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml.vb new file mode 100644 index 00000000..83a5832c --- /dev/null +++ b/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class MachinePanelV + +End Class diff --git a/EgtBEAMWALL.Core/MachinePanel/MachinePanelVM.vb b/EgtBEAMWALL.Core/MachinePanel/MachinePanelVM.vb new file mode 100644 index 00000000..88351e28 --- /dev/null +++ b/EgtBEAMWALL.Core/MachinePanel/MachinePanelVM.vb @@ -0,0 +1,357 @@ +Imports System.Collections.ObjectModel +Imports System.IO +Imports EgtBEAMWALL.Core +Imports EgtUILib +Imports EgtWPFLib5 + +Public Class MachinePanelVM + Inherits EgtWPFLib5.MachinePanelVM + +#Region "FIELDS & PROPERTIES" + + ' Radice del direttorio delle macchine + Private m_sMachinesRoot As String + + ' Macchina correntemente selezionata e quindi attiva + Private m_SelectedMachine As Machine = Nothing + Public Overrides Property SelectedMachine As Machine + Get + Return m_SelectedMachine + End Get + Set(value As Machine) + If value IsNot m_SelectedMachine Then + ' imposto macchina in DbGeometrico + If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) Then + m_SelectedMachine = value + End If + ' Salvo impostazione macchina corrente + SaveCurrentMachine() + NotifyPropertyChanged(NameOf(SelectedMachine)) + ' inizializzo la macchina selezionata come macchina corrente + Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType + SectionXMaterial.SetType(nMachType) + If Not IsNothing(value) Then + InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType) + Else + InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, m_SelectedMachine.Name, nMachType) + End If + ' mostro bottone tabella beam o wall a seconda del tipo + m_BeamTable_Visibility = If(nMachType = MachineType.BEAM OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed) + m_WallTable_Visibility = If(nMachType = MachineType.WALL OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed) + NotifyPropertyChanged(NameOf(BeamTable_Visibility)) + NotifyPropertyChanged(NameOf(WallTable_Visibility)) + ' carico i Parametri Q da mostrare (Beam, Wall o entrambi) in base al tipo di macchina selezionata + If Not IsNothing(Map.refConfigurationPageVM) Then + ' carico i parametri Q dei Process letti dall'ini + Map.refConfigurationPageVM.GetQParamsList() + ' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList + If Not IsNothing(Map.refConfigurationPageVM.QBTLParamVMList) Then + Map.refConfigurationPageVM.QBTLParamVMList.Clear() + End If + For Each PRCItem In Map.refConfigurationPageVM.PRCList + For Each QBTLParam In PRCItem.QBTLParamVMList + Map.refConfigurationPageVM.QBTLParamVMList.Add(QBTLParam) + Next + Next + NotifyPropertyChanged(NameOf(Map.refConfigurationPageVM.QBTLParamVMList)) + End If + ' aggiorno nome macchina in statusbar + Map.refMyStatusBarVM.RefreshMachName() + End If + End Set + End Property + + Private m_MachPanel_IsEnabled As Boolean = True + Public Property MachPanel_IsEnabled As Boolean + Get + Return m_MachPanel_IsEnabled + End Get + Set(value As Boolean) + m_MachPanel_IsEnabled = value + NotifyPropertyChanged("MachPanel_IsEnabled") + End Set + End Property + + Private m_BeamTable_Visibility As Visibility + Public ReadOnly Property BeamTable_Visibility As Visibility + Get + Return m_BeamTable_Visibility + End Get + End Property + + Private m_WallTable_Visibility As Visibility + Public ReadOnly Property WallTable_Visibility As Visibility + Get + Return m_WallTable_Visibility + End Get + End Property + + Public ReadOnly Property SetUp_Visibility As Visibility + Get + Return If(Map.refMainWindowVM.MainWindowM.bModifySetup, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + + +#Region "Messages" + + Public ReadOnly Property ToolDBMsg As String + Get + Return EgtMsg(MSG_MACHINEPAGEUC + 6) + End Get + End Property + Public ReadOnly Property MachiningDbMsg As String + Get + Return EgtMsg(MSG_MACHINEPAGEUC + 7) + End Get + End Property + Public ReadOnly Property SetUpMsg As String + Get + Return EgtMsg(MSG_ALARMSPAGEUC + 33) + End Get + End Property + +#End Region ' Messages + +#Region "ToolTip" + + Public ReadOnly Property ToolDBToolTip As String + Get + Return EgtMsg(5003) + End Get + End Property + Public ReadOnly Property MachiningDbToolTip As String + Get + Return EgtMsg(5004) + End Get + End Property + Public ReadOnly Property SetUpToolTip As String + Get + Return EgtMsg(31501) + End Get + End Property + +#End Region ' ToolTip + + ' Definizione comandi + Private m_cmdBeamTable As ICommand + Private m_cmdWallTable As ICommand + +#End Region 'FIELDS & PROPERTIES + +#Region "CONSTRUCTOR" + + Sub New() + ' Creo riferimento a questa classe in Map + Map.SetRefMachinePanelVM(Me) + ' recupero cartella radice delle macchine + m_sMachinesRoot = Map.refMainWindowVM.MainWindowM.sMachinesRoot + ' Carica macchine da cartella delle macchine + MyMachine.MachineListInit(m_sMachinesRoot, MachineList) + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Friend Sub LoadCurrentMachine() + If MachineList.Count = 0 Then Return + Dim CurrMachine As Machine = Nothing + Dim CurrMachineName As String = String.Empty + GetMainPrivateProfileString(S_MACH, K_CURRMACH, String.Empty, CurrMachineName) + Dim bFound As Boolean = False + If Not String.IsNullOrEmpty(CurrMachineName) Then + For Each Mach In MachineList + If Mach.Name = CurrMachineName Then + bFound = True + CurrMachine = Mach + Exit For + End If + Next + End If + If Not bFound And MachineList.Count > 0 Then + CurrMachine = MachineList(0) + End If + If Not IsNothing(CurrMachine) Then + If EgtSetCurrMachine(CurrMachine.Name) Then + SelectedMachine = CurrMachine + End If + End If + End Sub + + Friend Sub SaveCurrentMachine() + If IsNothing(m_SelectedMachine) Then Return + WriteMainPrivateProfileString(S_MACH, K_CURRMACH, SelectedMachine.Name) + End Sub + + Friend Sub UpdateCurrentMachine() + 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext) + Dim sMachName As String = String.Empty + If EgtGetCurrMachineName(sMachName) Then + For Each Mach In MachineList + If Mach.Name = sMachName Then + SelectedMachine = Mach + Exit For + End If + Next + End If + End Sub + + Friend Function BeamMachDb() As Boolean + ' Assegno le path + Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "Beam" + ' verifico se ci sono i file ini + Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini" + Dim sTabTemplPath As String = sBaseDir & "\BeamTableTemplate.ini" + If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then + ' apro finestra di gestione lavorazioni travi + Dim sTitle = EgtMsg(9000) 'Tabelle delle lavorazioni delle travi + Dim BeamMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath) + Dim BeamMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, BeamMchsWinVM) + BeamMchsWinV.ShowDialog() + Else + ' Impossibile aprire l'Editor delle lavorazioni delle travi.
Mancano i file di configurazione. - Errore + MessageBox.Show(EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + End If + Return True + End Function + + Friend Function WallMachDb() As Boolean + ' Assegno le path + Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "Wall" + ' verifico se ci sono i file ini + Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini" + Dim sTabTemplPath As String = sBaseDir & "\WallTableTemplate.ini" + If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then + ' apro finestra di gestione lavorazioni pareti + Dim sTitle = EgtMsg(9010) 'Tabelle delle lavorazioni delle pareti + Dim WallMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, False) + Dim WallMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, WallMchsWinVM) + WallMchsWinV.ShowDialog() + Else + ' Impossibile aprire l'Editor delle lavorazioni delle pareti.
Mancano i file di configurazione. - Errore + MessageBox.Show(EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + End If + Return True + End Function + + Public Overrides Sub ToolDb(ByVal param As Object) + If Not VerifyMachinesDir(m_sMachinesRoot) Then Return + ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa) + If Not EgtTdbReload() Then + EgtOutLog("Impossible reloading tool Db") + MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Return + End If + + Dim ToolDbWindowVM As New MyToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam") + Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM) + If ToolDbWindowVM.MatType <> 0 Then + ToolDbWindowV.Height = 640 + ToolDbWindowV.Width = 1024 + ToolDbWindowV.ShowDialog() + Else + Exit Sub + End If + + End Sub + + Public Overrides Sub MachDb(ByVal param As Object) + If Not VerifyMachinesDir(m_sMachinesRoot) Then Return + ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa) + If Not EgtMdbReload() Then + EgtOutLog("Impossible reloading machining Db") + MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Return + End If + Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone") + Dim MachDbWindowV As New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM) + + If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then + MachDbWindowV.Height = 768 + MachDbWindowV.Width = 1024 + MachDbWindowV.ShowDialog() + Else + Exit Sub + End If + + End Sub + + Public Overrides Sub SetUp(ByVal param As Object) + ' verifico che il file di configurazione attrezzaggio (lua) della macchina esista + If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then + EgtOutLog("SetUp error: SetUp configuration file doesn't exist ") + MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Return + End If + ' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato, + ' e testa e uscita dell'utensile attrezzato + EgtLuaExecFile(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) + ' verifico che le teste riportate in configurazione esistano + Dim Index As Integer = 1 + Dim nErr As Integer = 0 + While nErr = 0 + Dim sHead As String = String.Empty + nErr = 999 + EgtLuaSetGlobIntVar("STU.INDEX", Index) + EgtLuaCallFunction("STU.GetTcPosHeadGroupFromPos") + ' Leggo variabili + EgtLuaGetGlobStringVar("STU.HEAD", sHead) + EgtLuaGetGlobIntVar("STU.ERR", nErr) + If nErr = 0 Then + If EgtGetHeadExitCount(sHead) = 0 Then + MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Return + End If + End If + Index += 1 + End While + ' Reset lua + EgtLuaResetGlobVar("STU") + + Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) + SetUpWindow.Height = 614 + SetUpWindow.Width = 1024 + SetUpWindow.ShowDialog() + + End Sub + +#End Region + +#Region "COMMANDS" + +#Region "BeamTable" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property BeamTable_Command As ICommand + Get + If m_cmdBeamTable Is Nothing Then + m_cmdBeamTable = New Command(AddressOf BeamMachDb) + End If + Return m_cmdBeamTable + End Get + End Property + +#End Region ' BeamTable + +#Region "WallTable" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property WallTable_Command As ICommand + Get + If m_cmdWallTable Is Nothing Then + m_cmdWallTable = New Command(AddressOf WallMachDb) + End If + Return m_cmdWallTable + End Get + End Property + +#End Region ' WallTable + +#End Region ' COMMANDS + +End Class diff --git a/EgtBEAMWALL.Core/Resources/ProjectManager/Save.png b/EgtBEAMWALL.Core/Resources/ProjectManager/Save.png new file mode 100644 index 0000000000000000000000000000000000000000..0eca26039c38c97a380275d355f192ef802a4768 GIT binary patch literal 610 zcmV-o0-gPdP)~pMU@Vf!LzljGU~@j2=Md0a6{s0CG^^p|=7s{z)HEvV-OP z!>=4q9=v1FR|Xl!{XvS4ad4!m;sf^>F5dk>ewv~-U}j=unCPL-peN5ecyiz2H-8v< zKQS}JU;Z{)PK`PW4u1Y2znSy#*FV}gYQ>eWWI5=}lV1$`KK-V=n!yI9J^9XXN%pVX=QaDiLj{xa~t`%RN*Bg;`eI(!Va3hWH`-u)$7k2D_>L+Yo0 z45g<&Fg*G5kGhV^lHp{~5ocq_-20y4-1k33J4%LyiJ{4mkD*eBmm&MYN9rbYTRBdK zO*g-S9puISAB^>x2;M1& literal 0 HcmV?d00001 diff --git a/EgtBEAMWALL.Supervisor/BeamMachiningsWindow/BeamMachiningsWindowV.xaml b/EgtBEAMWALL.Supervisor/BeamMachiningsWindow/BeamMachiningsWindowV.xaml new file mode 100644 index 00000000..02bcbf79 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/BeamMachiningsWindow/BeamMachiningsWindowV.xaml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb index e057bd71..8d43b4c3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb @@ -4,11 +4,7 @@ Imports EgtUILib Imports EgtWPFLib5 Imports EgtBEAMWALL.Core Imports MS.Internal -Imports Org.BouncyCastle.X509 Imports Ionic.Zip -Imports Org.BouncyCastle.Bcpg -Imports Microsoft.VisualBasic.ApplicationServices -Imports Renci.SshNet.Security Public Class ConfigurationPageVM Inherits VMBase diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml index 49cc3924..1a271f72 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml @@ -64,7 +64,7 @@ + Margin="0,2,0,5"> @@ -114,5 +114,5 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index c46c1fec..82644cf7 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -264,15 +264,6 @@ ChangeMaterialWndV.xaml - - General_ConfigurationPageV.xaml - - - Machine_ConfigurationPageV.xaml - - - QParameter_ConfigurationPageV.xaml - @@ -280,6 +271,7 @@ FeatureListManagerV.xaml + PartInRawPartManagerWndV.xaml @@ -328,7 +320,6 @@ BeamMachiningsWindowV.xaml - BlockedWndV.xaml @@ -484,10 +475,6 @@ ConfigurationPageV.xaml - - MachinePanelV.xaml - - OptimizePanelV.xaml @@ -552,18 +539,6 @@ MSBuild:Compile Designer - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - Designer MSBuild:Compile @@ -784,10 +759,6 @@ MSBuild:Compile Designer - - MSBuild:Compile - Designer - Designer MSBuild:Compile diff --git a/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelV.xaml index 1e325112..6d211b1e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelV.xaml @@ -2,7 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" - IsEnabled="{Binding MachPanel_IsEnabled}"> + IsEnabled="{Binding MachPanel_IsEnabled}" + Background="Green"> diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb b/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb index 1c78294f..2962d1ac 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb @@ -242,9 +242,9 @@ Public Module CurrentMachine EgtLuaResetGlobVar("GWD") ' aggiorno parametro in gestore viste Core.ViewPanelVM.UpdateMachParam(m_nViewDir) - + End If ' leggo parametri macchina da WallData - ElseIf nType = MachineType.WALL Then + If nType = MachineType.WALL OrElse nType = MachineType.BOTH Then ' Assegno i dati EgtLuaCreateGlobTable("GWD") EgtLuaSetGlobStringVar("GWD.BASEDIR", Map.refMainWindowVM.MainWindowM.sWallRoot) From a6ef84ab328bc391b4f97ace5517ca013e00796c Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 13 Dec 2023 16:17:49 +0100 Subject: [PATCH 044/126] -Aggiunto PrintLabel_Msg al ConfigurationPageV del Supervisore --- .../ConfigurationPage/ConfigurationPageVM.vb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb index 2fb406b1..1feb8961 100644 --- a/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb +++ b/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb @@ -346,6 +346,12 @@ Public Class ConfigurationPageVM End Get End Property + Public ReadOnly Property PrintLabel_Msg As String + Get + Return EgtMsg(61894) + End Get + End Property + #End Region ' Messages #Region "Constructor" From 20357a3ebcdf1e38d468fb06a61b0502e23d287d Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 14 Dec 2023 14:42:42 +0100 Subject: [PATCH 045/126] -portato BeamMachiningsWindowV in Core --- .../BeamMachiningsWindowV.xaml | 26 +++++++++---------- EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj | 7 +++++ .../EgtBEAMWALL.Supervisor.vbproj | 7 ----- .../Utility/Dictionary.xaml | 4 +-- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 7 ----- .../Utility/Dictionary.xaml | 4 +-- 6 files changed, 24 insertions(+), 31 deletions(-) diff --git a/EgtBEAMWALL.Core/BeamMachiningsWindow/BeamMachiningsWindowV.xaml b/EgtBEAMWALL.Core/BeamMachiningsWindow/BeamMachiningsWindowV.xaml index e0a034bb..cfa320aa 100644 --- a/EgtBEAMWALL.Core/BeamMachiningsWindow/BeamMachiningsWindowV.xaml +++ b/EgtBEAMWALL.Core/BeamMachiningsWindow/BeamMachiningsWindowV.xaml @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" - xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core" Title="{Binding Title}" Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStyle="None" ResizeMode="NoResize" @@ -24,17 +24,17 @@ Margin="5,0,5,0" Style="{StaticResource TabControl_OnlyHeaders}"/> - + - --> + + + + - + - + From 2de010d5968932b383387f9c1a0648bf09685d97 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 10 Jan 2024 12:55:03 +0100 Subject: [PATCH 051/126] sistemato merge errato --- .../ConfigurationPage/ConfigurationPageV.xaml | 10 +++++----- .../Statistics/PDFHelper.vb | 3 --- EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb | 14 +------------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml index 265099ef..dc6653aa 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml @@ -1,9 +1,9 @@ + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" + xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"> diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb index 36b309a6..0b394711 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb @@ -188,7 +188,6 @@ Module PDFHelper ' -1 -> riempio colonne della riga degli header ' >=0 -> riempio le colonne con i valori dei pezzi Dim Itemlist As IEnumerable(Of Object) = Nothing -<<<<<<< HEAD ' Controllo se bPreview è true mostra il PDF di preview se no il PDF completo If bPreview Then Itemlist = New List(Of Object) @@ -202,7 +201,6 @@ Module PDFHelper Itemlist = Map.refStatisticsVM.RawPartList End Select End If -======= Select Case nListType Case ListTypes.PART Itemlist = Map.refProjectVM.BTLStructureVM.BTLPartVMList @@ -212,7 +210,6 @@ Module PDFHelper If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refStatisticsVM.LoadRawPart() Itemlist = Map.refStatisticsVM.RawPartList End Select ->>>>>>> feature/NewPage 'If m_ActivePage = Pages.VIEW Then ' Itemlist = Map.refProjectVM.BTLStructureVM.BTLPartVMList.ToList() 'ElseIf m_ActivePage = Pages.MACHINING Then diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb b/EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb index d6bb5367..2adfe5dd 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Map.vb @@ -34,9 +34,7 @@ Module Map Private m_refFeatureManagerVM As FeatureManagerVM Private m_refAddSectionXMaterialWndVM As AddSectionXMaterialWndVM Private m_refStatisticsTimePanelVM As StatisticsTimePanelVM -<<<<<<< HEAD Private m_refPDFEditorVM As PDFEditorVM -======= Private m_refOnlyProdManagerVM As OnlyProdManagerVM Private m_refBTLPartManagerVM As BTLPartManagerVM Private m_refRawPartManagerVM As RawPartManagerVM @@ -44,7 +42,6 @@ Module Map Private m_refFeatureListManagerVM As FeatureListManagerVM Private m_refProdProjManagerVM As ProdProjManagerVM Private m_refProjWndVM As ProjWndVM ->>>>>>> feature/NewPage Private m_refSpecialPanelVM As SpecialPanelVM 'Private m_refOpenProjectFileDialogVM As OpenProjectFileDialogVM 'Private m_refRawPartTabVM As RawPartTabVM @@ -253,15 +250,12 @@ Module Map End Get End Property -<<<<<<< HEAD - Public ReadOnly Property refPDFEditorVM As PDFEditorVM Get Return m_refPDFEditorVM End Get End Property - -======= + Public ReadOnly Property refOnlyProdManagerVM As OnlyProdManagerVM Get Return m_refOnlyProdManagerVM @@ -304,8 +298,6 @@ Module Map End Get End Property - ->>>>>>> feature/NewPage Public ReadOnly Property refSpecialPanelVM As SpecialPanelVM Get Return m_refSpecialPanelVM @@ -524,13 +516,11 @@ Module Map Return Not IsNothing(m_refStatisticsTimePanelVM) End Function -<<<<<<< HEAD Friend Function SetRefPDFEditorVM(PDFEditorVM As PDFEditorVM) As Boolean m_refPDFEditorVM = PDFEditorVM Return Not IsNothing(m_refPDFEditorVM) End Function -======= Friend Function SetRefOnlyProdManagerVM(OnlyProdManagerVM As OnlyProdManagerVM) As Boolean m_refOnlyProdManagerVM = OnlyProdManagerVM Return Not IsNothing(m_refOnlyProdManagerVM) @@ -566,8 +556,6 @@ Module Map Return Not IsNothing(m_refProjWndVM) End Function - ->>>>>>> feature/NewPage Friend Function SetRefSpecialPanelVM(SpecialPanelVM As SpecialPanelVM) As Boolean m_refSpecialPanelVM = SpecialPanelVM Return Not IsNothing(m_refSpecialPanelVM) From 3646c5832cc2519edabf7535867d25bb6f637f96 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 10 Jan 2024 14:24:34 +0100 Subject: [PATCH 052/126] sistemato pdfhelper --- .../ConfigurationPage/ConfigurationPageV.xaml | 6 +++--- .../Statistics/PDFHelper.vb | 17 +++++++++++------ .../Statistics/StatisticsVM.vb | 2 ++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml index dc6653aa..8333f1a3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml @@ -1,9 +1,8 @@ + xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"> @@ -72,6 +71,7 @@
+ - + @@ -144,7 +144,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb index 8509aff8..123e7b52 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb @@ -114,6 +114,18 @@ Public Class PartInRawPartListVM End Get End Property + Public ReadOnly Property ROTATION_Msg As String + Get + Return EgtMsg(61737) + End Get + End Property + + Public ReadOnly Property INVERSION_Msg As String + Get + Return EgtMsg(61738) + End Get + End Property + #End Region ' Messages #Region "CONSTRUCTOR" diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index e8d2fbb7..c73beddc 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -1,9 +1,7 @@ Imports System.Collections.ObjectModel -Imports System.IO Imports EgtBEAMWALL.Core Imports EgtUILib Imports EgtWPFLib5 -Imports Org.BouncyCastle.Crypto.Digests.SkeinEngine Public Class LeftPanelVM Inherits VMBase From 3d957138eee5dba71e7e95946339b6cfab84df54 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 24 Jan 2024 17:22:54 +0100 Subject: [PATCH 064/126] -aggiunto controllo su errore esecuzione execbeam -aggiunto messaggio per rotazione e inversione --- EgtBEAMWALL.Core/Constants/ConstBeam.vb | 2 + EgtBEAMWALL.Core/MachGroupModel/PartM.vb | 2 + EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb | 2 - .../BTLPartManager/BTLPartManagerVM.vb | 45 +++- .../BTLViewModel/BTLStructureVM.vb | 2 + .../ItemParamList/PartInRawPartListV.xaml | 4 +- .../ItemParamList/PartInRawPartListVM.vb | 12 + .../LeftPanel/LeftPanelVM.vb | 14 +- .../LeftPanel/OnlyProdLeftPanelV.xaml | 1 + .../MachGroupPanel/PartVM.vb | 239 +++++++++++++----- 10 files changed, 250 insertions(+), 73 deletions(-) diff --git a/EgtBEAMWALL.Core/Constants/ConstBeam.vb b/EgtBEAMWALL.Core/Constants/ConstBeam.vb index a07fbb48..ac4948bb 100644 --- a/EgtBEAMWALL.Core/Constants/ConstBeam.vb +++ b/EgtBEAMWALL.Core/Constants/ConstBeam.vb @@ -144,6 +144,8 @@ Public Const BTL_PRT_INVERTED As String = "INVERTED" Public Const BTL_PRT_MATERIAL As String = "MATERIAL" Public Const BTL_PRT_VOLUME As String = "VOLUME" + Public Const BTL_PRT_ROT As String = "ROT" + Public Const BTL_PRT_FLIP As String = "FLIP" ' parametri pezzo Public Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER" Public Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER" diff --git a/EgtBEAMWALL.Core/MachGroupModel/PartM.vb b/EgtBEAMWALL.Core/MachGroupModel/PartM.vb index 211cae4d..c4222cd9 100644 --- a/EgtBEAMWALL.Core/MachGroupModel/PartM.vb +++ b/EgtBEAMWALL.Core/MachGroupModel/PartM.vb @@ -482,6 +482,8 @@ Public Class PartM EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP) EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY) EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL) + EgtGetInfo(nPartId, BTL_PRT_ROT, NewPartM.m_dROT) + EgtGetInfo(nPartId, BTL_PRT_FLIP, NewPartM.m_nFLIP) Dim nTemp As Integer = 0 If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then nTemp = 0 diff --git a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb index 739e8f1c..2240b4e7 100644 --- a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb @@ -1,11 +1,9 @@ Imports System.Collections.ObjectModel Imports System.Collections.Specialized Imports System.ComponentModel -Imports System.IO Imports System.Windows Imports System.Windows.Input Imports System.Windows.Media -Imports EgtBEAMWALL.Core Imports EgtUILib Imports EgtWPFLib5 diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb index 61ced861..29d1096f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb @@ -709,6 +709,12 @@ Public Class BTLPartManagerVM EgtSetMode(nDuploId, GDB_MD.STD) nPartDuploIdList.Add(nDuploId) Next + '' salvo lista info + Dim saveInfoBeamList As MyMachGroupVM = BeamMachGroup + 'Dim saveInfoBeamList As New List(Of PartVM) + 'For Each info As PartVM In BeamMachGroup.PartVMList + ' saveInfoBeamList.Add(info) + 'Next ' calcolo posizione nuovo pezzo per rispettare ordine lunghezze Dim nInsertIndex As Integer ' scrivo dati di tutti i pezzi @@ -767,7 +773,38 @@ Public Class BTLPartManagerVM End While Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt" If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then - Return False + EgtOutLog("Fallito inserimento grezzo nella barra in AddPartToBeam") + + ' elimino duplo + For Each nDuploId In nPartDuploIdList + EgtErase(nDuploId) + EgtRemoveRawPart(nDuploId) + Next + + ' rimuovo info duplo e aggiorno info grezzo + nPartIndex = 0 + For nIndex = 0 To BeamMachGroup.PartVMList.Count - 1 + If nPartIndex < nPartDuploIdList.Count() AndAlso BeamMachGroup.PartVMList(nIndex).dL > PartsToAdd(0).dL Then + EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1) + nPartIndex += 1 + ElseIf nPartIndex < nPartDuploIdList.Count() AndAlso BeamMachGroup.PartVMList(nIndex).dL < PartsToAdd(0).dL Then + EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1) + nPartIndex += 1 + End If + EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + nPartIndex + 1) + EgtSetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, BeamMachGroup.PartVMList(nIndex).nPartId & "," & DoubleToString(BeamMachGroup.PartVMList(nIndex).dPOSX, 3)) + Next + + ' elimino vecchio grezzo ed eseguo script creazione nuovo + nRawId = EgtGetFirstRawPart() + While nRawId <> GDB_ID.NULL + EgtRemoveRawPart(nRawId) + nRawId = EgtGetFirstRawPart() + End While + + If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then + EgtOutLog("Fallita esecuzione ExecBeam. ERRORE") + End If End If For nDuploIndex = 0 To PartsToAdd.Count - 1 EgtSetInfo(nPartDuploIdList(nDuploIndex), MGR_PRT_ROT, PartsToAdd(nDuploIndex).nROTATED) @@ -776,7 +813,11 @@ Public Class BTLPartManagerVM ' aggiorno lista pezzi BeamMachGroup.MyMachGroupM.RefreshPartList() ' seleziono pezzo aggiunto - If BeamMachGroup.PartVMList.Count > nInsertIndex Then BeamMachGroup.SelPart = BeamMachGroup.PartVMList(nInsertIndex) + If BeamMachGroup.PartVMList.Count > nInsertIndex Then + BeamMachGroup.SelPart = BeamMachGroup.PartVMList(nInsertIndex) + Else + BeamMachGroup.SelPart = BeamMachGroup.PartVMList(nInsertIndex - 1) + End If Return True End Function diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb index fdde01ce..a93796f4 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb @@ -88,6 +88,7 @@ Public Class BTLStructureVM If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.PROJ ' rendo enable bottone parameters Map.refLeftPanelVM.SetParametersIsEnabled(True) + Map.refLeftPanelVM.SetData_IsEnabled(False) ' verifico reset mark su tutti i pezzi For Each BTLPart In m_BTLPartVMList EgtResetMark(BTLPart.nPartId) @@ -101,6 +102,7 @@ Public Class BTLStructureVM If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.NULL ' rendo disable bottone parameters Map.refLeftPanelVM.SetParametersIsEnabled(False) + Map.refLeftPanelVM.SetData_IsEnabled(True) If m_PrevSelectionType = SelectionTypes.SELECT_ Then EgtBeamShowFacesName(False) EgtBeamShowLoadingSide(False, False) diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml index e9ef3e82..dda45340 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml @@ -109,7 +109,7 @@ - + @@ -144,7 +144,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb index 8509aff8..123e7b52 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb @@ -114,6 +114,18 @@ Public Class PartInRawPartListVM End Get End Property + Public ReadOnly Property ROTATION_Msg As String + Get + Return EgtMsg(61737) + End Get + End Property + + Public ReadOnly Property INVERSION_Msg As String + Get + Return EgtMsg(61738) + End Get + End Property + #End Region ' Messages #Region "CONSTRUCTOR" diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index e8d2fbb7..70a833ef 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -1,9 +1,7 @@ Imports System.Collections.ObjectModel -Imports System.IO Imports EgtBEAMWALL.Core Imports EgtUILib Imports EgtWPFLib5 -Imports Org.BouncyCastle.Crypto.Digests.SkeinEngine Public Class LeftPanelVM Inherits VMBase @@ -45,6 +43,18 @@ Public Class LeftPanelVM NotifyPropertyChanged(NameOf(Parameters_IsEnabled)) End Sub + Private m_Data_IsEnabled As Boolean = False + Public ReadOnly Property Data_IsEnabled As Boolean + Get + Return m_Data_IsEnabled + End Get + End Property + Friend Sub SetData_IsEnabled(bIsEnabled As Boolean) + m_Data_IsEnabled = bIsEnabled + NotifyPropertyChanged(NameOf(Data_IsEnabled)) + End Sub + + ' Definizione comandi Private m_cmdData As ICommand Private m_cmdParameter As ICommand diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml index 5200be6e..db17f7e0 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml @@ -83,6 +83,7 @@ HorizontalAlignment="Left"> diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb index aafe66d1..a35727ef 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb @@ -201,19 +201,47 @@ Public Class PartVM ' recupero box del layer box Dim b3Box As New BBox3d EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) - If EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB) Then + Dim vtAxes As Vector3d + ' se travi ruoto attorno all'asse Z + If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then + vtAxes = Vector3d.Z_AX + ' se pareti ruoto attorno all'asse X + ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then + vtAxes = Vector3d.X_AX + End If + If EgtRotate(nPartId, b3Box.Center, vtAxes, 180, GDB_RT.GLOB) Then m_PartM.nFLIP = If(value, 180, 0) EgtSetInfo(nPartId, MGR_PRT_FLIP, If(value, 180, 0)) Else NotifyPropertyChanged(NameOf(bFLIP)) End If - ' recupero box del pezzo - Dim b3Part As New BBox3d - EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part) - ' calcolo distanza tra i box - Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min - ' reinserisco il pezzo nel grezzo - EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId) + If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then + ' recupero box del pezzo + Dim b3Part As New BBox3d + EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part) + ' calcolo distanza tra i box + Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min + ' reinserisco il pezzo nel grezzo + EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId) + ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then + ' elimino vecchio grezzo ed eseguo script creazione nuovo + DeleteOldRaw() + Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt" + If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then + EgtOutLog("Fallita creazione barra nell'ExecBeam in bFlip") + ' elimino vecchio grezzo ed eseguo script creazione nuovo + DeleteOldRaw() + If EgtRotate(nPartId, b3Box.Center, vtAxes, 180, GDB_RT.GLOB) Then + m_PartM.nFLIP = 180 + EgtSetInfo(nPartId, MGR_PRT_FLIP, 180) + Else + NotifyPropertyChanged(NameOf(m_PartM.nFLIP)) + End If + If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then + EgtOutLog("Fallita esecuzione ExecBeam. ERRORE") + End If + End If + End If ' lo riseleziono EgtSelectObj(nPartId) ' resetto validazione del pezzo @@ -293,66 +321,140 @@ Public Class PartVM End Sub Private Sub Rotate(IsPositive As Boolean) - ' salvo posizione - Dim dTempPosX As Double = m_PartM.dPOSX - Dim dTempPosY As Double = m_PartM.dPOSY - ' tolgo il pezzo dal grezzo - EgtRemovePartFromRawPart(nPartId) - ' 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) - ' se invertito lo reinverto - Dim bFliped As Boolean = bFLIP - If bFliped Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB) - Dim dAng As Double = If(IsPositive, 90, -90) - ' eseguo rotazione - Dim bOk As Boolean = EgtRotate(nPartId, b3Box.Center, -Vector3d.Z_AX, dAng, GDB_RT.GLOB) - If bOk Then - Dim TempRot = m_PartM.dROT - TempRot += dAng - If TempRot >= 360 Then - TempRot -= 360 - ElseIf TempRot < 0 Then - TempRot += 360 + If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then + ' elimino vecchio grezzo ed eseguo script creazione nuovo + DeleteOldRaw() + ' 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) + ' se invertito lo reinverto + If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB) + ' eseguo rotazione attorno asse X + Dim dRot As Integer = 0 + If dW <> dH Then + dRot = If(IsPositive, 180, -180) + ElseIf dW = dH Then + dRot = If(IsPositive, 90, -90) End If - m_PartM.dROT = TempRot - EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT) - End If - ' ripristino eventuale inversione - If bFliped Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB) - ' recupero box del pezzo - Dim b3Part As New BBox3d - EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part) - 'aggiorno box del box con rotazione - EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) - ' calcolo distanza tra i box - Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min ' Vector3d.NULL - ' calcolo posizione rispetto al riferimento - Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE - Case BWType.WALL - ' se parete, valuto angolo di posizionamento - Select Case CurrentMachine.NestingCorner - Case MCH_CR.TL - 'vtDeltaBox = New Vector3d(b3Box.Min.x - b3Part.Min.x, b3Box.Max.y - b3Part.Max.y, 0) - dTempPosY = dTempPosY - dW + dL - Case MCH_CR.BL + Dim bOk As Boolean = EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, dRot, GDB_RT.GLOB) + If bOk Then + Dim TempRot = m_PartM.dROT + TempRot += dRot + If TempRot >= 360 Then + TempRot -= 360 + ElseIf TempRot < 0 Then + TempRot += 360 + End If + m_PartM.dROT = TempRot + EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT) + End If + ' ripristino eventuale inversione + If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB) + Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt" + If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then + EgtOutLog("Fallita creazione barra nell'ExecBeam in Rotate") + ' elimino vecchio grezzo ed eseguo script creazione nuovo + DeleteOldRaw() + ' annullo Flip + If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB) + ' ripristino rotazione + Dim dRotation As Integer = 0 + If dW <> dH Then + dRotation = m_PartM.dROT + dRot + m_PartM.dROT = dRotation + If dRotation >= 360 Then + dRotation = dRot + m_PartM.dROT = 0 + End If + ElseIf dW = dH Then + dRotation = m_PartM.dROT - dRot + If dRotation = 0 Then + dRotation = 3 * dRot + m_PartM.dROT = 0 + ElseIf dRotation = 90 Then + dRotation += 2 * dRot + m_PartM.dROT = 90 + ElseIf dRotation = 180 Then + dRotation += dRot + m_PartM.dROT = 180 + ElseIf dRotation < 0 Then + dRotation += 4 * dRot + m_PartM.dROT = 270 + End If + End If + EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, dRotation, GDB_RT.GLOB) + ' salvo informazione + EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT) + ' annullo Flip + If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB) + If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then + EgtOutLog("Fallita esecuzione ExecBeam. ERRORE") + End If + NotifyPropertyChanged(NameOf(m_PartM.dROT)) + End If + ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then + ' salvo posizione + Dim dTempPosX As Double = m_PartM.dPOSX + Dim dTempPosY As Double = m_PartM.dPOSY + ' tolgo il pezzo dal grezzo + EgtRemovePartFromRawPart(nPartId) + ' 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) + ' se invertito lo reinverto + If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB) + Dim dAng As Double = If(IsPositive, 90, -90) + ' eseguo rotazione + Dim bOk As Boolean = EgtRotate(nPartId, b3Box.Center, -Vector3d.Z_AX, dAng, GDB_RT.GLOB) + If bOk Then + Dim TempRot = m_PartM.dROT + TempRot += dAng + If TempRot >= 360 Then + TempRot -= 360 + ElseIf TempRot < 0 Then + TempRot += 360 + End If + m_PartM.dROT = TempRot + EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT) + End If + ' ripristino eventuale inversione + If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB) + ' recupero box del pezzo + Dim b3Part As New BBox3d + EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part) + 'aggiorno box del box con rotazione + EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) + ' calcolo distanza tra i box + Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min ' Vector3d.NULL + ' calcolo posizione rispetto al riferimento + Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE + Case BWType.WALL + ' se parete, valuto angolo di posizionamento + Select Case CurrentMachine.NestingCorner + Case MCH_CR.TL + 'vtDeltaBox = New Vector3d(b3Box.Min.x - b3Part.Min.x, b3Box.Max.y - b3Part.Max.y, 0) + dTempPosY = dTempPosY - dW + dL + Case MCH_CR.BL 'vtDeltaBox = b3Box.Min - b3Part.Min ' non cambio posizioni - Case MCH_CR.TR - 'vtDeltaBox = b3Box.Max - b3Part.Max - dTempPosX = dTempPosX - dL + dW - dTempPosY = dTempPosY - dW + dL - Case MCH_CR.BR - 'vtDeltaBox = New Vector3d(b3Box.Max.x - b3Part.Max.x, b3Box.Min.y - b3Part.Min.y, 0) - dTempPosX = dTempPosX - dL + dW - End Select - Case Else - ' non cambio nulla - End Select - ' reinserisco il pezzo nel grezzo - EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId) + Case MCH_CR.TR + 'vtDeltaBox = b3Box.Max - b3Part.Max + dTempPosX = dTempPosX - dL + dW + dTempPosY = dTempPosY - dW + dL + Case MCH_CR.BR + 'vtDeltaBox = New Vector3d(b3Box.Max.x - b3Part.Max.x, b3Box.Min.y - b3Part.Min.y, 0) + dTempPosX = dTempPosX - dL + dW + End Select + Case Else + ' non cambio nulla + End Select + ' reinserisco il pezzo nel grezzo + EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId) + End If ' lo riseleziono EgtSelectObj(nPartId) ' resetto validazione del pezzo @@ -360,6 +462,13 @@ Public Class PartVM NotifyPropertyChanged(NameOf(sROT)) End Sub + Private Sub DeleteOldRaw() + Dim nRawId As Integer = EgtGetFirstRawPart() + While nRawId <> GDB_ID.NULL + EgtRemoveRawPart(nRawId) + nRawId = EgtGetFirstRawPart() + End While + End Sub Friend Sub SelectBTLPart() ' eseguo la selezione nella lista pezzi Dim nBTLPartId As Integer = MyMachGroupPanelM.DuploGetOriginal(nPartId) From 8b96a073867eb83a307ce8d968a49b6045b0270d Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 31 Jan 2024 12:03:54 +0100 Subject: [PATCH 065/126] - pulizia codice - aggoirnato controllo su errore script aggiunta nuovo pezzo --- EgtBEAMWALL.Core/Constants/ConstBeam.vb | 2 - EgtBEAMWALL.Core/MachGroupModel/PartM.vb | 6 +- .../BTLPartManager/BTLPartManagerVM.vb | 45 ++---- .../BTLViewModel/BTLFeatureVM.vb | 2 +- .../BTLViewModel/BTLParamVM.vb | 16 ++ .../BTLViewModel/BTLStructureVM.vb | 140 +----------------- .../ItemParamList/FeatureListV.xaml | 3 +- .../ItemParamList/OnlyProdFeatureListV.xaml | 7 +- .../ItemParamList/PParameterListV.xaml | 4 +- .../MachGroupPanel/MyMachGroupPanelVM.vb | 26 ---- .../MachGroupPanel/MyMachGroupVM.vb | 91 +----------- .../MachGroupPanel/PartVM.vb | 37 ++--- .../ProjManager/ProjManagerVM.vb | 46 ------ .../Utility/Configuration.vb | 1 - 14 files changed, 53 insertions(+), 373 deletions(-) diff --git a/EgtBEAMWALL.Core/Constants/ConstBeam.vb b/EgtBEAMWALL.Core/Constants/ConstBeam.vb index ac4948bb..a07fbb48 100644 --- a/EgtBEAMWALL.Core/Constants/ConstBeam.vb +++ b/EgtBEAMWALL.Core/Constants/ConstBeam.vb @@ -144,8 +144,6 @@ Public Const BTL_PRT_INVERTED As String = "INVERTED" Public Const BTL_PRT_MATERIAL As String = "MATERIAL" Public Const BTL_PRT_VOLUME As String = "VOLUME" - Public Const BTL_PRT_ROT As String = "ROT" - Public Const BTL_PRT_FLIP As String = "FLIP" ' parametri pezzo Public Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER" Public Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER" diff --git a/EgtBEAMWALL.Core/MachGroupModel/PartM.vb b/EgtBEAMWALL.Core/MachGroupModel/PartM.vb index c4222cd9..b182f54a 100644 --- a/EgtBEAMWALL.Core/MachGroupModel/PartM.vb +++ b/EgtBEAMWALL.Core/MachGroupModel/PartM.vb @@ -482,8 +482,8 @@ Public Class PartM EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP) EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY) EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL) - EgtGetInfo(nPartId, BTL_PRT_ROT, NewPartM.m_dROT) - EgtGetInfo(nPartId, BTL_PRT_FLIP, NewPartM.m_nFLIP) + EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT) + EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP) Dim nTemp As Integer = 0 If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then nTemp = 0 @@ -516,8 +516,6 @@ Public Class PartM ' leggo PosX, PosY, Rot e Flip 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_nFLIP) End If ' leggo volume If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewPartM.dVolume) Then diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb index 29d1096f..981d4d75 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb @@ -709,18 +709,13 @@ Public Class BTLPartManagerVM EgtSetMode(nDuploId, GDB_MD.STD) nPartDuploIdList.Add(nDuploId) Next - '' salvo lista info - Dim saveInfoBeamList As MyMachGroupVM = BeamMachGroup - 'Dim saveInfoBeamList As New List(Of PartVM) - 'For Each info As PartVM In BeamMachGroup.PartVMList - ' saveInfoBeamList.Add(info) - 'Next ' calcolo posizione nuovo pezzo per rispettare ordine lunghezze Dim nInsertIndex As Integer ' scrivo dati di tutti i pezzi Dim dPosX As Double = BeamMachGroup.dStartCut Dim nPartIndex As Integer = 0 Dim nIndex As Integer + Dim bDuploInfo As Boolean = False ' ciclo sui pezzi For nIndex = 0 To BeamMachGroup.PartVMList.Count - 1 For PartsToAddIndex = nPartIndex To PartsToAdd.Count - 1 @@ -774,34 +769,26 @@ Public Class BTLPartManagerVM Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt" If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then EgtOutLog("Fallito inserimento grezzo nella barra in AddPartToBeam") - ' elimino duplo For Each nDuploId In nPartDuploIdList EgtErase(nDuploId) - EgtRemoveRawPart(nDuploId) Next - - ' rimuovo info duplo e aggiorno info grezzo - nPartIndex = 0 + ' aggiorno info grezzo For nIndex = 0 To BeamMachGroup.PartVMList.Count - 1 - If nPartIndex < nPartDuploIdList.Count() AndAlso BeamMachGroup.PartVMList(nIndex).dL > PartsToAdd(0).dL Then - EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1) - nPartIndex += 1 - ElseIf nPartIndex < nPartDuploIdList.Count() AndAlso BeamMachGroup.PartVMList(nIndex).dL < PartsToAdd(0).dL Then - EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1) - nPartIndex += 1 - End If - EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + nPartIndex + 1) EgtSetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, BeamMachGroup.PartVMList(nIndex).nPartId & "," & DoubleToString(BeamMachGroup.PartVMList(nIndex).dPOSX, 3)) Next - + ' rimuovo info duplo + While EgtGetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, nPartDuploIdList(0)) + bDuploInfo = EgtGetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, nPartDuploIdList(0)) + EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1) + nIndex += 1 + End While ' elimino vecchio grezzo ed eseguo script creazione nuovo nRawId = EgtGetFirstRawPart() While nRawId <> GDB_ID.NULL EgtRemoveRawPart(nRawId) nRawId = EgtGetFirstRawPart() End While - If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then EgtOutLog("Fallita esecuzione ExecBeam. ERRORE") End If @@ -815,8 +802,8 @@ Public Class BTLPartManagerVM ' seleziono pezzo aggiunto If BeamMachGroup.PartVMList.Count > nInsertIndex Then BeamMachGroup.SelPart = BeamMachGroup.PartVMList(nInsertIndex) - Else - BeamMachGroup.SelPart = BeamMachGroup.PartVMList(nInsertIndex - 1) + ElseIf bDuploInfo Then + BeamMachGroup.SelPart = BeamMachGroup.PartVMList(BeamMachGroup.PartVMList.Count - 1) End If Return True End Function @@ -1100,10 +1087,6 @@ Public Class BTLPartManagerVM ' se modalita' assemblato Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked Configuration.AssembledMode(bShowBuilding) - 'If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then - ' ' devo smontarlo prima di ruotare le travi - ' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - 'End If ' inverto i pezzi selezionati For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts Part.Invert() @@ -1138,10 +1121,6 @@ Public Class BTLPartManagerVM ' se modalita' assemblato Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked Configuration.AssembledMode(bShowBuilding) - 'If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then - ' ' devo smontarlo prima di ruotare le travi - ' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - 'End If ' ruoto i pezzi selezionati For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts Part.BackRotation(False, False) @@ -1183,10 +1162,6 @@ Public Class BTLPartManagerVM ' se modalita' assemblato Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked Configuration.AssembledMode(bShowBuilding) - 'If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then - ' ' devo smontarlo prima di ruotare le travi - ' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - 'End If ' ruoto i pezzi selezionati For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts Part.ForwardRotation(False, False) diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLFeatureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLFeatureVM.vb index dc0ab084..fafed97a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLFeatureVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLFeatureVM.vb @@ -165,7 +165,7 @@ Public Class BTLFeatureVM ' se in View If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(m_BTLPartM)) Then ' imposto modificato per copie - Dim cc = Map.refMachGroupPanelVM.MachGroupVMList + 'Dim cc = Map.refMachGroupPanelVM.MachGroupVMList MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId) End If NotifyPropertyChanged(NameOf(bDO)) diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLParamVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLParamVM.vb index 8d562621..891e1186 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLParamVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLParamVM.vb @@ -135,6 +135,22 @@ Public Class BTLParamVM NotifyPropertyChanged("sValue") Return End If + ' recupero ParentPart + Dim ParentPart As BTLPartM = TryCast(m_BTLParamM.ParentFeature.ParentPart, BTLPartM) + ' recupero PartId + Dim nPartId As Integer = ParentPart.nPartId + ' numero di pezzi inseriti nelle barre + Dim INPROD As Integer = 0 + EgtDuploInRawCount(nPartId, INPROD) + ' recupero pezzi lavorati da Db + Dim nDoneCnt As Integer = DbControllers.m_ProjController.getCountItemState(ProjectManagerVM.CurrProj.nProjId, nPartId, ItemState.Assigned) + ' controllo se i pezzi sono lavorati se si messaggio di warning altrimenti messaggio informativo + If nDoneCnt > 0 Then + MessageBox.Show("Pezzo " & nPartId & " non modificato in " & INPROD & " barra/e perche' settata/e come da produrre", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + dNewValue = m_BTLParamM.dValue + Else + MessageBox.Show("Pezzo " & nPartId & " modificato in " & INPROD & " barra/e grezza/e", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Information) + End If UpdateParamValue(dNewValue, "") Case Else UpdateParamValue(0, value) diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb index a93796f4..ab20a09f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb @@ -84,7 +84,6 @@ Public Class BTLStructureVM Select Case m_SelectionType Case SelectionTypes.SELECT_ ' imposto modalita' proj su vista feature - 'Map.refProjectVM.SelProdProj = ProdProj.PROJ If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.PROJ ' rendo enable bottone parameters Map.refLeftPanelVM.SetParametersIsEnabled(True) @@ -98,7 +97,6 @@ Public Class BTLStructureVM Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility)) Case SelectionTypes.HIGHLIGHT ' imposto modalita' nulla su vista feature - 'Map.refProjectVM.SelProdProj = ProdProj.NULL If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.NULL ' rendo disable bottone parameters Map.refLeftPanelVM.SetParametersIsEnabled(False) @@ -122,8 +120,6 @@ Public Class BTLStructureVM ' aggiornamento grafica 'Map.refLeftPanelVM.PartShowAllChanged() Configuration.UpdateGraphics() - 'If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged() - 'If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged() 'Map.refLeftPanelVM.FeatureSelectionChanged() If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged() Map.refCALCPanelVM.SetIsEnabledForSelPart() @@ -219,29 +215,12 @@ Public Class BTLStructureVM ' aggiornamento grafica 'Map.refLeftPanelVM.PartShowAllChanged() Configuration.UpdateGraphics() - 'If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged() - 'If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged() End Sub Private Sub SelectBTLPart(BtlPart As BTLPartVM) m_SelBTLPart = BtlPart If Map.refMainMenuVM.SelPage = Pages.VIEW Then Configuration.SelectedPieces(BtlPart.nPartId, Me) - 'EgtBeamShowFacesName(False) - 'EgtBeamShowLoadingSide(False, False) - 'Map.refProjectVM.MacroFeature_IsEnabled = True - '' se modalità building, la tolgo - 'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then - ' ShowBuilding(False, False) - 'End If - '' seleziono pezzo nella scena - 'SceneSelPartSelection() - '' seleziono pezzo in Db geometrico - 'EgtBeamSetPart(BtlPart.nPartId) - 'EgtBeamShowFacesName(True) - 'Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM) - 'Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) - 'EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight) ' seleziono pagina BottomPanel If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART) @@ -261,25 +240,6 @@ Public Class BTLStructureVM EgtBeamShowLoadingSide(False, False) ' trovo ed evidenzio MachGroup e Duplo di questo pezzo Configuration.SetSearchPiece(BtlPart.nPartId) - 'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then - ' Dim MachGroupList As New List(Of MyMachGroupVM) - ' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - ' Dim bFound As Boolean = False - ' For Each Part As PartVM In Machgroup.PartVMList - ' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then - ' Part.SetSearchFound() - ' bFound = True - ' Else - ' Part.ResetSearchFound() - ' End If - ' Next - ' If bFound Then - ' Machgroup.SetSearchFound() - ' Else - ' Machgroup.ResetSearchFound() - ' End If - ' Next - 'End If ' seleziono pezzo nella scena SceneSelPartSelection() Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) @@ -294,21 +254,6 @@ Public Class BTLStructureVM EgtResetCurrMachGroup() End If Configuration.SelectedPieces(BtlPart.nPartId, Me) - 'EgtBeamShowFacesName(False) - 'EgtBeamShowLoadingSide(False, False) - 'Map.refProjectVM.MacroFeature_IsEnabled = True - '' se modalità building, la tolgo - 'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then - ' ShowBuilding(False, False) - 'End If - '' seleziono pezzo nella scena - 'SceneSelPartSelection() - '' seleziono pezzo in Db geometrico - 'EgtBeamSetPart(BtlPart.nPartId) - 'EgtBeamShowFacesName(True) - 'Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM) - 'Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) - 'EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight) ' seleziono la prima feature If Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVM = BtlPart.BTLFeatureVMList(0) ' aggiorno stato selezionato tutto @@ -341,11 +286,6 @@ Public Class BTLStructureVM Private Sub DeselectBTLPart(BtlPart As BTLPartVM) ' se necessario tolgo solido dal precedentemente selezionato Configuration.DeselectSolid(BtlPart.nPartId, True) - 'If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then - ' ' tolgo eventuale indicazione solido rimasta da pezzo precedente - ' Map.refShowBeamPanelVM.SetShowSolid(False) - ' Map.refProjectVM.BTLStructureVM.ShowSolid(BtlPart.nPartId, False, False) - 'End If If m_SelBTLPart Is BtlPart Then EgtBeamShowFacesName(False) EgtBeamShowLoadingSide(False, False) @@ -353,7 +293,7 @@ Public Class BTLStructureVM NotifyPropertyChanged(NameOf(SelBTLPart)) End If ' disabilito eventuale feature selezionata - If Not IsNothing(BtlPart.m_SelBTLFeatureVM) Then BtlPart.SelBTLFeatureVM = Nothing + If Not IsNothing(BtlPart.m_SelBTLFeatureVM) AndAlso (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING) Then BtlPart.SelBTLFeatureVM = Nothing '' deevidenzio MachGroup e Duplo di questo pezzo 'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then ' Dim MachGroupList As New List(Of MyMachGroupVM) @@ -371,7 +311,7 @@ Public Class BTLStructureVM ' End If ' Next 'End If - EgtResetCurrMachGroup() + 'EgtResetCurrMachGroup() EgtDraw() End Sub Private Sub HighlightBTLPart(BtlPart As BTLPartVM) @@ -393,25 +333,6 @@ Public Class BTLStructureVM If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then ' trovo ed evidenzio MachGroup e Duplo di questo pezzo Configuration.SetSearchPiece(BtlPart.nPartId) - 'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then - ' Dim MachGroupList As New List(Of MyMachGroupVM) - ' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - ' Dim bFound As Boolean = False - ' For Each Part As PartVM In Machgroup.PartVMList - ' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then - ' Part.SetSearchFound() - ' bFound = True - ' Else - ' Part.ResetSearchFound() - ' End If - ' Next - ' If bFound Then - ' Machgroup.SetSearchFound() - ' Else - ' Machgroup.ResetSearchFound() - ' End If - ' Next - 'End If End If ' seleziono pagina BottomPanel If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL) @@ -435,22 +356,6 @@ Public Class BTLStructureVM End If ' deevidenzio MachGroup e Duplo di questo pezzo Configuration.ResetSearchPiece(BtlPart.nPartId) - 'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then - ' Dim MachGroupList As New List(Of MyMachGroupVM) - ' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - ' Dim bFound As Boolean = False - ' For Each Part As PartVM In Machgroup.PartVMList - ' Dim i = EgtDuploGetOriginal(Part.nPartId) - ' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then - ' Part.ResetSearchFound() - ' bFound = True - ' End If - ' Next - ' If bFound Then - ' Machgroup.ResetSearchFound() - ' End If - ' Next - 'End If ' seleziono pagina BottomPanel 'Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL) If bDraw Then EgtDraw() @@ -476,9 +381,6 @@ Public Class BTLStructureVM If Not IsNothing(m_SelBTLPart) Then ' se necessario tolgo solido dal precedentemente selezionato Configuration.DeselectSolid() - 'If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then - ' Map.refShowBeamPanelVM.SetShowSolid(False) - 'End If ' disabilito eventuale feature selezionata If Not IsNothing(m_SelBTLPart.m_SelBTLFeatureVM) Then m_SelBTLPart.SelBTLFeatureVM = Nothing End If @@ -508,25 +410,6 @@ Public Class BTLStructureVM ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then ' trovo ed evidenzio MachGroup e Duplo di questo pezzo Configuration.SetSearchPiece(m_SelBTLPart.nPartId) - 'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then - ' Dim MachGroupList As New List(Of MyMachGroupVM) - ' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - ' Dim bFound As Boolean = False - ' For Each Part As PartVM In Machgroup.PartVMList - ' If EgtDuploGetOriginal(Part.nPartId) = m_SelBTLPart.nPartId Then - ' Part.SetSearchFound() - ' bFound = True - ' Else - ' Part.ResetSearchFound() - ' End If - ' Next - ' If bFound Then - ' Machgroup.SetSearchFound() - ' Else - ' Machgroup.ResetSearchFound() - ' End If - ' Next - 'End If ' seleziono pezzo nella scena SceneSelPartSelection() Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) @@ -551,25 +434,6 @@ Public Class BTLStructureVM Map.refShowBeamPanelVM.bShowAll = False ' trovo ed evidenzio MachGroup e Duplo di questo pezzo Configuration.ResetSearchPiece(m_SelBTLPart.nPartId) - 'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then - ' Dim MachGroupList As New List(Of MyMachGroupVM) - ' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - ' Dim bFound As Boolean = False - ' For Each Part As PartVM In Machgroup.PartVMList - ' If EgtDuploGetOriginal(Part.nPartId) = m_SelBTLPart.nPartId Then - ' Part.SetSearchFound() - ' bFound = True - ' Else - ' Part.ResetSearchFound() - ' End If - ' Next - ' If bFound Then - ' Machgroup.SetSearchFound() - ' Else - ' Machgroup.ResetSearchFound() - ' End If - ' Next - 'End If Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) EgtZoom(ZM.ALL) End If diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml index 1c4a088d..15b87fc3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml @@ -24,7 +24,8 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml index 420259a8..835b8830 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml @@ -19,13 +19,16 @@ Style="{StaticResource DataGrid_CustomHighLight}"> - + - + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml index 4dc32425..664743f7 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml @@ -34,8 +34,8 @@ + Visibility="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" + HorizontalAlignment="Center"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb index 8196fa81..2dcf6aff 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb @@ -24,39 +24,13 @@ Public Class MyMachGroupPanelVM Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId ' deevidenzio MachGroup e Duplo di questo pezzo Configuration.ResetSearchPiece(nSelBTLPartId) - 'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then - ' Dim MachGroupList As New List(Of MyMachGroupVM) - ' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - ' Dim bFound As Boolean = False - ' For Each Part As PartVM In Machgroup.PartVMList - ' If EgtDuploGetOriginal(Part.nPartId) = nSelBTLPartId Then - ' Part.ResetSearchFound() - ' bFound = True - ' End If - ' Next - ' If bFound Then - ' Machgroup.ResetSearchFound() - ' End If - ' Next - 'End If End If End If If Not IsNothing(SelectedMachGroup) AndAlso Not IsNothing(SelectedMachGroup.SelPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Configuration.ResetSearch(SelectedMachGroup.SelPart.nPartId) - 'For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1 - ' Dim nDuploOriginalId As Integer = 0 - ' If EgtGetInfo(SelectedMachGroup.SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then - ' Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound() - ' Exit For - ' End If - 'Next End If ' se modalita' assemblato Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked) - 'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then - ' ' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi - ' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - 'End If ' se precedente pezzo selezionato If Not IsNothing(value) AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then Dim SelBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0) diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb index 75458e17..b210e59e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb @@ -1,6 +1,4 @@ Imports System.Collections.ObjectModel -Imports System.Collections.Specialized -Imports System.ComponentModel Imports System.IO Imports System.Windows.Threading Imports EgtBEAMWALL.Core @@ -30,47 +28,15 @@ Public Class MyMachGroupVM Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId ' deevidenzio MachGroup e Duplo di questo pezzo Configuration.ResetSearchPiece(nSelBTLPartId) - 'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then - ' Dim MachGroupList As New List(Of MyMachGroupVM) - ' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - ' Dim bFound As Boolean = False - ' For Each Part As PartVM In Machgroup.PartVMList - ' If EgtDuploGetOriginal(Part.nPartId) = nSelBTLPartId Then - ' Part.ResetSearchFound() - ' bFound = True - ' End If - ' Next - ' If bFound Then - ' Machgroup.ResetSearchFound() - ' End If - ' Next - 'End If End If If Not IsNothing(m_SelPart) Then ' deevidenzio BTLPart di questo pezzo If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Configuration.ResetSearch(m_SelPart.nPartId) - 'For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1 - ' Dim nDuploOriginalId As Integer = 0 - ' If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then - ' Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound() - ' Exit For - ' End If - 'Next End If End If ' se modalita' assemblato Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked) - 'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then - ' ' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi - ' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - 'End If - 'If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then - ' ' deseleziono pezzo in lista BTLPart - ' For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1 - ' Map.refProjectVM.BTLStructureVM.SelBTLParts.Remove(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex)) - ' Next - 'End If End If m_SelPart = value ' seleziono pezzo @@ -78,10 +44,11 @@ Public Class MyMachGroupVM If Not IsNothing(value) Then If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then ' imposto modalita' prod su vista feature - 'Map.refProjectVM.SelProdProj = ProdProj.PROD Map.refProdProjManagerVM.SelProdProj = ProdProj.PROD - '' deseleziono pezzo in lista BTLPart - 'Map.refProjectVM.BTLStructureVM.SelBTLParts.Clear() + ' deseleziono pezzo in lista BTLPart + For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1 + Map.refProjectVM.BTLStructureVM.SelBTLParts.RemoveFromList(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex)) + Next End If EgtSelectObj(SelPart.nPartId) If Map.refMainMenuVM.SelPage = Pages.MACHINING Then @@ -89,15 +56,7 @@ Public Class MyMachGroupVM End If ' trovo ed evidenzio BTLPart di questo pezzo If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then - 'Dim MachGroupList As New List(Of MyMachGroupVM) Configuration.SetSearch(m_SelPart.nPartId) - 'For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1 - ' Dim nDuploOriginalId As Integer = 0 - ' If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then - ' Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).SetSearchFound() - ' Exit For - ' End If - 'Next End If End If @@ -150,14 +109,6 @@ Public Class MyMachGroupVM ' verifico se la dimensione e' maggiore del box minimo dei pezzi Dim b3Parts As New BBox3d Configuration.VerifyMaxDimension(m_PartVMList, b3Parts) - 'Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box") - 'EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts) - 'For PartIndex = 1 To m_PartVMList.Count - 1 - ' Dim b3Part As New BBox3d - ' nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box") - ' EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part) - ' b3Parts.Add(b3Part) - 'Next Dim b3RawPart As New BBox3d EgtGetRawPartBBox(nRawPartId, b3RawPart) Dim dMinValue As Double = 0 @@ -175,19 +126,6 @@ Public Class MyMachGroupVM ' riporto il grezzo nell'angolo tavola di origine Dim b3Tab As New BBox3d Configuration.SelectCorner(b3Tab, nRawPartId) - 'EgtGetTableArea(1, b3Tab) - 'Dim p3OrigOnTab As Point3d - 'Select Case CurrentMachine.OrigCorner - ' Case MCH_CR.BL - ' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0) - ' Case MCH_CR.BR - ' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0) - ' Case MCH_CR.TL - ' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0) - ' Case MCH_CR.TR - ' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0) - 'End Select - 'EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner) ' sposto tutti i pezzi di quanto si e' accorciato il grezzo If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.BR Then For Each Part In m_PartVMList @@ -223,14 +161,6 @@ Public Class MyMachGroupVM ' verifico se la dimensione e' maggiore del box minimo dei pezzi Dim b3Parts As New BBox3d Configuration.VerifyMaxDimension(m_PartVMList, b3Parts) - 'Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box") - 'EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts) - 'For PartIndex = 1 To m_PartVMList.Count - 1 - ' Dim b3Part As New BBox3d - ' nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box") - ' EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part) - ' b3Parts.Add(b3Part) - 'Next Dim b3RawPart As New BBox3d EgtGetRawPartBBox(nRawPartId, b3RawPart) Dim dMinValue As Double = 0 @@ -248,19 +178,6 @@ Public Class MyMachGroupVM ' riporto il grezzo nell'angolo tavola di origine Dim b3Tab As New BBox3d Configuration.SelectCorner(b3Tab, nRawPartId) - 'EgtGetTableArea(1, b3Tab) - 'Dim p3OrigOnTab As Point3d - 'Select Case CurrentMachine.OrigCorner - ' Case MCH_CR.BL - ' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0) - ' Case MCH_CR.BR - ' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0) - ' Case MCH_CR.TL - ' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0) - ' Case MCH_CR.TR - ' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0) - 'End Select - 'EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner) ' sposto tutti i pezzi di quanto si e' accorciato il grezzo If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.TL Then For Each Part In m_PartVMList diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb index a35727ef..512dd96c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb @@ -1,7 +1,6 @@ Imports System.Collections.ObjectModel Imports System.Collections.Specialized Imports System.ComponentModel -Imports System.IO Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.DataLayer.DatabaseModels Imports EgtUILib @@ -360,39 +359,21 @@ Public Class PartVM ' annullo Flip If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB) ' ripristino rotazione - Dim dRotation As Integer = 0 - If dW <> dH Then - dRotation = m_PartM.dROT + dRot - m_PartM.dROT = dRotation - If dRotation >= 360 Then - dRotation = dRot - m_PartM.dROT = 0 - End If - ElseIf dW = dH Then - dRotation = m_PartM.dROT - dRot - If dRotation = 0 Then - dRotation = 3 * dRot - m_PartM.dROT = 0 - ElseIf dRotation = 90 Then - dRotation += 2 * dRot - m_PartM.dROT = 90 - ElseIf dRotation = 180 Then - dRotation += dRot - m_PartM.dROT = 180 - ElseIf dRotation < 0 Then - dRotation += 4 * dRot - m_PartM.dROT = 270 - End If + Dim TempRot = m_PartM.dROT + TempRot -= dRot + If TempRot >= 360 Then + TempRot -= 360 + ElseIf TempRot < 0 Then + TempRot += 360 End If - EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, dRotation, GDB_RT.GLOB) - ' salvo informazione + m_PartM.dROT = TempRot EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT) - ' annullo Flip + EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, -dRot, GDB_RT.GLOB) If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB) If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then EgtOutLog("Fallita esecuzione ExecBeam. ERRORE") End If - NotifyPropertyChanged(NameOf(m_PartM.dROT)) + NotifyPropertyChanged(NameOf(sROT)) End If ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then ' salvo posizione diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb index 33447800..61815d3a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb @@ -563,15 +563,6 @@ Public Class ProjManagerVM If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROJ, 1, EgtMsg(63007), "", 100) ' Project saving ' se vista tutti i pezzi Configuration.ShowAllPieces(bShowBuilding, bShowSolid, True, False) - 'If Map.refShowBeamPanelVM.bShowAll Then - ' ' verifico se assemblato e lo annullo per salvataggio - ' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked - ' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - ' ' se vista singolo pezzo - 'Else - ' bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked - ' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False) - 'End If ' imposto ProjId di caricamento m_nLoadingProjId = CurrProj.nProjId Map.refSceneHostVM.SaveProject() @@ -861,18 +852,6 @@ Public Class ProjManagerVM Dim bShowSolid As Boolean = False Dim nSelPartId As Integer = GDB_ID.NULL Configuration.ShowAllPieces(bShowBuilding, bShowSolid, nSelPartId, True) - 'If Map.refShowBeamPanelVM.bShowAll Then - ' ' verifico se assemblato e lo annullo per salvataggio - ' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked - ' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - ' ' se vista singolo pezzo - 'Else - ' bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked - ' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False) - ' ' se pezzo selezionato lo segno e metto vista tutti - ' nSelPartId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId - ' Map.refProjectVM.BTLStructureVM.ShowAll(False) - 'End If Dim sDir As String = String.Empty GetMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, "", sDir) @@ -1182,26 +1161,6 @@ Public Class ProjManagerVM ' elimino i pezzi da sovrascrivere nel progetto corrente Configuration.DeletePieces(UpdateBTLWndVM.BTLPartList) - 'For Each BTLPartToOverwriteWith In UpdateBTLWndVM.BTLPartList - ' If BTLPartToOverwriteWith.bInsert Then - ' Dim BTLPartToUpdate As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPDN = BTLPartToOverwriteWith.nPDN) - ' ' se BTLPartToUpdate è Nothing significa che il pezzo è nuovo e quindi basta accodarlo senza eliminare nulla - ' If Not IsNothing(BTLPartToUpdate) Then - ' Dim nPartToDeleteId As Integer = BTLPartToUpdate.nPartId - ' Dim nCurrPartId = EgtGetCurrPart() - ' EgtErase(nPartToDeleteId) - ' nCurrPartId = EgtGetCurrPart() - ' ' verifico se rimuovere sezione dalla lista - ' If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToUpdate AndAlso x.Section = BTLPartToUpdate.Section) Then - ' Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToUpdate.Section) - ' End If - ' ' rimuovo dalla lista pezzi - ' Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToUpdate) - ' Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing) - ' Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index) - ' End If - ' End If - 'Next ' salvo gli id degli AsseBase presenti nel progetto corrente Dim AsseBaseIdList As New List(Of Integer) @@ -1384,11 +1343,6 @@ Public Class ProjManagerVM Dim bShowBuilding As Boolean = False If Map.refMainMenuVM.SelPage = Pages.VIEW Then Configuration.ShowAllPieces(bShowBuilding) - 'If Map.refShowBeamPanelVM.bShowAll Then - ' ' verifico se assemblato e lo annullo per salvataggio - ' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked - ' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - 'End If End If ' per ogni BTLInfo nel progetto riporto il relativo nome del BTL diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Configuration.vb b/EgtBEAMWALL.ViewerOptimizer/Utility/Configuration.vb index 9e116178..127ddc51 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Configuration.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Configuration.vb @@ -1,7 +1,6 @@ Imports System.Collections.ObjectModel Imports EgtBEAMWALL.Core Imports EgtUILib -Imports EgtWPFLib5 Module Configuration From 827c955d1dd5fe1f52ef05db663f754dce4a6e7f Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 1 Feb 2024 17:08:34 +0100 Subject: [PATCH 066/126] -modifica finestra feature con templete macro --- .../AddFeatureWnd/AddFeatureWndV.xaml | 56 +++++++++--- .../AddFeatureWnd/AddFeatureWndVM.vb | 90 ++++++++++++++++++- .../BTLViewModel/BTLParamVM.vb | 2 +- .../FeatureListManagerVM.vb | 10 ++- .../Utility/Dictionary.xaml | 6 ++ 5 files changed, 144 insertions(+), 20 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml index 1be62179..b63a149c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml @@ -5,7 +5,7 @@ xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStyle="None" ResizeMode="NoResize" - SizeToContent="WidthAndHeight" + WindowState="Maximized" WindowStartupLocation="CenterOwner" IsClosable="False" IsMinimizable="False" @@ -46,12 +46,13 @@ Grid.Column="1" DisplayMemberPath="ghDesc" Width="200" + HorizontalAlignment="Left" Style="{StaticResource FeatureComboBox}"/> - + + + + + + + + + + + + + + + + + + + + - diff --git a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/NewMacroFeatureWnd.xaml b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/NewMacroFeatureWnd.xaml index 18716b10..dc108b41 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/NewMacroFeatureWnd.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/NewMacroFeatureWnd.xaml @@ -27,21 +27,20 @@ Style="{StaticResource OptionTextBlock}"/> + Margin="0,6,5,0"/> Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5dZ)S5dnW>Uy%R+0vSm}K~z{r?Uy}M z6Hyd~&)Lk-N(VFyDOEDzAD|Z2+Bn+i{sZDzQjpdHklun&_z??iVf_3DWMr@mu^~`t z>rD1=&ds~v3UTgk5;Af2nK`rPJ)50<_vU_5&N#!k_Q&S&T?%9eib&`a2|rKNVubef zt@BVo*68ufGl(QN-!*SpK>D-Q7TRntK@rv3->7!<3d-)EAUmhl{+M{?4+2~rfdnrs zApO`nT6HZGPH&)Mt?^R-gc4M0&P zki7|~b}6EY8)??zEkr)_98GB{)epZ|K#q*W=o=(A>dl4tBh!B9&`dFt4isKI4}XSc zsvlCBve{neFo`46?C-(&w^T2zQ^)J3WAU+>|f5DPKlnN+;xS{>_hjkQW$DO9{$dbs@EQfldIhoo}wptxr$Vd|Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5dZ)S5dnW>Uy%R+0zXMaK~z{r?Uy}o z6G0G$XU-BWsUoLAaSK@XKj2G(E`kODMeKq;jwmScA3%_QkVHs;DT3%g1W1|AmJzLE znmDOKi{u;T-5WbTa!BX%IhN5q(&}brPr7$!_V$A^<{7qUx@`4!N$3Mr^BWc++U^PY ze1|-FMXUKm+B~|g_D9zz^o1(s&`OH#sa#9qx*GM4P=e_u)}ko{~>B z6?i5wAyJ-qFVW0R&g#+=6?M}*)MLeEE`%Iu{IN4fvIK^rij8hnA0;%iCj*(;K78(M zredg+ptAHxUuwIuqTC}mQKg;Ef)EWe1RF7PlYz_#mxI#DXN!h`u%LX4!vQExRR1^E zwdbOXD6kPTHyOwbGUQ6f`xZTAtJgLQ9NW|3m0ow2nR(6pA&8;R+++x~BTENZKDpAN zAyb%#Q4|{o-_XpR8KJ)~O)fV&<-s7w9q80VF_Zo%eC@QwXKJD*VJuNt?R5>4K}%)z zk6`{Y^)E1~2m2;$3nwNOQ8{AlnP1UhTR1WERlZ<-8BFT)T~PnuiJmr@sJLXJ;*yDq z%S=S+f?U1&=I32=&oG-z2`#fHJJ>0r?g63OX|SE}g3o@aBZ)6Zlc0#yYyDg - + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsV.xaml index 78c792ea..236d6583 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsV.xaml @@ -138,7 +138,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb index 2cb8fbc4..49fd571a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb @@ -359,7 +359,7 @@ Public Class StatisticsVM sFileName = ProjectManagerVM.CurrProj.sProjDirPath & "\" & "Statistics.pdf" ElseIf Pages.MACHINING OrElse (Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.bVisOtt_Selected) Then sFileName = ProjectManagerVM.CurrProd.sProdDirPath & "\" & ProjectManagerVM.CurrProd.sProdId & " - " & "Statistics.pdf" - PrevSelect() + If Not bOnlyProd Then PrevSelect() End If renderer.PdfDocument.Save(sFileName) From 5d4bd85f85339c82574b7197008e3da8ed037af3 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 22 Feb 2024 17:46:42 +0100 Subject: [PATCH 074/126] -aggiornato nomi variabili macro --- EgtBEAMWALL.Core/Constants/ConstGen.vb | 2 +- .../AddFeatureWnd/AddFeatureWndVM.vb | 6 +++--- .../AddFeatureWnd/NewAddFeatureWndV.xaml | 4 ++-- .../MacroFeatureWnd/MacroFeatureWndVM.vb | 10 +++++----- EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowM.vb | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/EgtBEAMWALL.Core/Constants/ConstGen.vb b/EgtBEAMWALL.Core/Constants/ConstGen.vb index 3f75b1b9..80e79e0f 100644 --- a/EgtBEAMWALL.Core/Constants/ConstGen.vb +++ b/EgtBEAMWALL.Core/Constants/ConstGen.vb @@ -68,7 +68,7 @@ Public Module ConstGen ' Sottodirettorio per Csv automatico Public Const PRODS_DIR As String = "Prods" ' Sottodirettorio per Macro - Public Const MACRO_DIR As String = "Macro" + Public Const MACRODEFAULT_DIR As String = "MacroDefault" ' Sottodirettorio per MacroCustom Public Const MACROCUSTOM_DIR As String = "MacroCustom" ' Sottodirettorio per Magazzino diff --git a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndVM.vb index 68db1883..f8732539 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndVM.vb @@ -239,7 +239,7 @@ Public Class AddFeatureWndVM #Region "METHODS" Private Sub GetMacroListDefault(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer) - Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDir) + Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroCustomDir) For Each File In AllFilesInDir If Path.GetExtension(File).ToLower() = ".lua" Then If File.Contains(FILENAMESEPARATOR) Then @@ -256,7 +256,7 @@ Public Class AddFeatureWndVM End If If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then If Core.Configuration.bOnlyProd Then - MacroList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroDir & "\Template\" & sMacroNameFromFileName & ".png")) + MacroList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png")) Else MacroList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName)) End If @@ -271,7 +271,7 @@ Public Class AddFeatureWndVM Private Sub GetMacroListCustom(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer) nIdMacroName = 0 - Dim AllFilesInDirCustom As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDirCustom) + Dim AllFilesInDirCustom As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir) For Each File In AllFilesInDirCustom If Path.GetExtension(File).ToLower() = ".lua" Then If File.Contains(FILENAMESEPARATOR) Then diff --git a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/NewAddFeatureWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/NewAddFeatureWndV.xaml index 2db97f6b..c14ff374 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/NewAddFeatureWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/NewAddFeatureWndV.xaml @@ -62,7 +62,7 @@ - - 5 Then - File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDirCustom & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) + File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) ElseIf Not bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel > 5 Then - File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) + File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) Else - File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDirCustom & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) + File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) End If Else - File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) + File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) End If End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowM.vb b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowM.vb index 2f28a939..d3be5ffa 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowM.vb @@ -144,13 +144,13 @@ Public Class MainWindowM End Get End Property - Friend ReadOnly Property sMacroDir As String + Friend ReadOnly Property sMacroDefaultDir As String Get - Return m_sDataDir & "\" & MACRO_DIR + Return m_sDataDir & "\" & MACRODEFAULT_DIR End Get End Property - Friend ReadOnly Property sMacroDirCustom As String + Friend ReadOnly Property sMacroCustomDir As String Get Return m_sDataDir & "\" & MACROCUSTOM_DIR End Get From 9bb1b49883c1a020c1ef548cf2f6bf45e3e2b127 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 23 Feb 2024 09:38:34 +0100 Subject: [PATCH 075/126] -aggiornato nomi macro list --- .../AddFeatureWnd/AddFeatureWndV.xaml | 4 +- .../AddFeatureWnd/AddFeatureWndVM.vb | 44 +++++++++---------- .../AddFeatureWnd/NewAddFeatureWndV.xaml | 8 ++-- .../FeatureListManagerVM.vb | 10 ++--- .../MacroFeatureWnd/MacroFeatureWndVM.vb | 8 ++-- .../MacroFeatureWnd/NewMacroFeatureWnd.xaml | 2 +- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml index 7c615336..803156c4 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml @@ -51,8 +51,8 @@ Grid.Row="1" Margin="0,5,0,0" Style="{StaticResource OptionTextBlock}"/> - m_nSelMacroCustom Then - m_nSelMacroCustom = value + If value <> m_nSelMacroDefault Then + m_nSelMacroDefault = value End If End Set End Property @@ -97,9 +97,9 @@ Public Class AddFeatureWndVM End If NotifyPropertyChanged(NameOf(sDrawPath)) ' carico eventuali file Macro - MacroList.Clear() + MacroCustomList.Clear() If Core.Configuration.bOnlyProd Then - NewMacroCustomList.Clear() + MacroDefaultList.Clear() End If m_MacroFilePathList = New List(Of String) m_MacroCustomFilePathList = New List(Of String) @@ -112,7 +112,7 @@ Public Class AddFeatureWndVM GetMacroListDefault(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName) ' ricavo lista file Macro Custom If Core.Configuration.bOnlyProd Then GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName) - If MacroList.Count > 0 Then + If MacroCustomList.Count > 0 Then MacroList_IsEnabled = True Else MacroList_IsEnabled = False @@ -136,21 +136,21 @@ Public Class AddFeatureWndVM End Set End Property - Private m_MacroList As New ObservableCollection(Of Object) - Public ReadOnly Property MacroList As ObservableCollection(Of Object) + Private m_MacroCustomList As New ObservableCollection(Of Object) + Public ReadOnly Property MacroCustomList As ObservableCollection(Of Object) Get - Return m_MacroList + Return m_MacroCustomList End Get End Property - Private m_nSelMacro As Integer = -1 - Public Property nSelMacro As Integer + Private m_nSelMacroCustom As Integer = -1 + Public Property nSelMacroCustom As Integer Get - Return m_nSelMacro + Return m_nSelMacroCustom End Get Set(value As Integer) - If value <> m_nSelMacro Then - m_nSelMacro = value + If value <> m_nSelMacroCustom Then + m_nSelMacroCustom = value End If End Set End Property @@ -256,9 +256,9 @@ Public Class AddFeatureWndVM End If If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then If Core.Configuration.bOnlyProd Then - MacroList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png")) + MacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png")) Else - MacroList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName)) + MacroCustomList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName)) End If m_MacroFilePathList.Add(File) nIdMacroName += 1 @@ -287,7 +287,7 @@ Public Class AddFeatureWndVM sMacroNameFromFileName = DataFromFileName(1) End If If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then - NewMacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName)) + MacroDefaultList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName)) m_MacroCustomFilePathList.Add(File) nIdMacroName += 1 End If diff --git a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/NewAddFeatureWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/NewAddFeatureWndV.xaml index c14ff374..3fba3d4c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/NewAddFeatureWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/NewAddFeatureWndV.xaml @@ -65,8 +65,8 @@ - - = 0 Then + If AddFeatureWndVM.nSelMacroDefault >= 0 Then bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroCustomFilePathList(nSelMacro)) Else bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroFilePathList(nSelMacro)) @@ -296,17 +296,17 @@ Public Class FeatureListManagerVM Dim AddNewFeatureWnd As New NewAddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM) If AddNewFeatureWnd.ShowDialog() Then ' verifico se una Macro è selezionata - If AddFeatureWndVM.nSelMacroCustom >= 0 Then - CreateNewFeature(AddFeatureWndVM.NewMacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat) + If AddFeatureWndVM.nSelMacroDefault >= 0 Then + CreateNewFeature(AddFeatureWndVM.MacroDefaultList.Count, AddFeatureWndVM.nSelMacroDefault, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat) Else - CreateNewFeature(AddFeatureWndVM.MacroList.Count, AddFeatureWndVM.nSelMacro, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat) + CreateNewFeature(AddFeatureWndVM.MacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat) End If End If Else Dim AddFeatureWnd As New AddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM) If AddFeatureWnd.ShowDialog() Then ' verifico se una Macro è selezionata - CreateNewFeature(AddFeatureWndVM.MacroList.Count, AddFeatureWndVM.nSelMacro, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat) + CreateNewFeature(AddFeatureWndVM.MacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat) End If End If End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndVM.vb index a3d1ee7e..59abfd78 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndVM.vb @@ -93,7 +93,7 @@ Public Class MacroFeatureWndVM Public ReadOnly Property bCustomVisibility As Visibility Get - Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5, Visibility.Visible, Visibility.Collapsed) + Return If(Map.refMainWindowVM.MainWindowM.nUserLevel >= 10, Visibility.Visible, Visibility.Collapsed) End Get End Property @@ -197,10 +197,10 @@ Public Class MacroFeatureWndVM "MACRO.PROCID") 'nSelFeature.ParentPart.NewProcId() & Next If bOnlyProd Then - If m_bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel > 5 Then - File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) - ElseIf Not bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel > 5 Then + If m_bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel >= 10 Then File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) + ElseIf Not bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel >= 10 Then + File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) Else File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) End If diff --git a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/NewMacroFeatureWnd.xaml b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/NewMacroFeatureWnd.xaml index dc108b41..ffab0500 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/NewMacroFeatureWnd.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/NewMacroFeatureWnd.xaml @@ -29,7 +29,7 @@ Grid.Column="1" HorizontalAlignment="Left" Style="{StaticResource OptionTextBlock}"/> - Date: Fri, 23 Feb 2024 11:10:41 +0100 Subject: [PATCH 076/126] -aggiunto controllo su visualizzazione rotazione e inversione su nuova pagina --- EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb | 1 + .../ItemParamList/PartInRawPartListVM.vb | 6 +++++- EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb b/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb index 7777f509..500c9f42 100644 --- a/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb +++ b/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb @@ -9,6 +9,7 @@ Public Const S_RAWPARTLIST_BEAM As String = "DG_RawPartList_BEAM" Public Const S_RAWPARTLIST_WALL As String = "DG_RawPartList_WALL" Public Const S_PARTINRAWPARTLIST_BEAM As String = "DG_PartInRawPartList_BEAM" + Public Const S_PARTINRAWPARTLISTONLYPROD_BEAM As String = "DG_PartInRawPartListOnlyProd_BEAM" Public Const S_PARTINRAWPARTLIST_WALL As String = "DG_PartInRawPartList_WALL" Public Const S_PARAMETERLIST_P As String = "DG_ParameterList_P" Public Const S_PARAMETERLIST_Q As String = "DG_ParameterList_Q" diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb index 123e7b52..3e658e6b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb @@ -142,7 +142,11 @@ Public Class PartInRawPartListVM Friend Sub UpdateColumns(nMachType As MachineType) If nMachType = MachineType.BEAM Then PartInRawPartColumns.Clear() - GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns) + If bOnlyProd Then + GetPrivateProfileColumns(S_PARTINRAWPARTLISTONLYPROD_BEAM, PartInRawPartColumns) + Else + GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns) + End If ElseIf nMachType = MachineType.WALL Then PartInRawPartColumns.Clear() GetPrivateProfileColumns(S_PARTINRAWPARTLIST_WALL, PartInRawPartColumns) diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb index 512dd96c..d99e25c2 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb @@ -222,7 +222,7 @@ Public Class PartVM Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min ' reinserisco il pezzo nel grezzo EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId) - ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then + ElseIf bOnlyProd AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then ' elimino vecchio grezzo ed eseguo script creazione nuovo DeleteOldRaw() Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt" @@ -320,7 +320,7 @@ Public Class PartVM End Sub Private Sub Rotate(IsPositive As Boolean) - If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then + If bOnlyProd AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then ' elimino vecchio grezzo ed eseguo script creazione nuovo DeleteOldRaw() ' recupero layer del box From a6cd836e0d2fd800c352c2bd8c6701ce828dc2ad Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 23 Feb 2024 14:44:44 +0100 Subject: [PATCH 077/126] -aggiornato grafica visualizzazione colonne rotazione, inversione --- .../Constants/ConstDataGridColumnsIni.vb | 1 - .../ItemParamList/PartInRawPartListV.xaml | 16 ++++++++++------ .../ItemParamList/PartInRawPartListVM.vb | 11 ++++++----- .../ItemParamList/RawPartListV.xaml | 8 +++++--- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb b/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb index 500c9f42..7777f509 100644 --- a/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb +++ b/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb @@ -9,7 +9,6 @@ Public Const S_RAWPARTLIST_BEAM As String = "DG_RawPartList_BEAM" Public Const S_RAWPARTLIST_WALL As String = "DG_RawPartList_WALL" Public Const S_PARTINRAWPARTLIST_BEAM As String = "DG_PartInRawPartList_BEAM" - Public Const S_PARTINRAWPARTLISTONLYPROD_BEAM As String = "DG_PartInRawPartListOnlyProd_BEAM" Public Const S_PARTINRAWPARTLIST_WALL As String = "DG_PartInRawPartList_WALL" Public Const S_PARAMETERLIST_P As String = "DG_ParameterList_P" Public Const S_PARAMETERLIST_Q As String = "DG_ParameterList_Q" diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml index dda45340..0c21667d 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml @@ -108,9 +108,11 @@ - - - + + + + + @@ -143,9 +145,11 @@ - - - + + + + + - - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLDataWnd/BTLDataWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/BTLDataWnd/BTLDataWndV.xaml index d533502d..e031fa88 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLDataWnd/BTLDataWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/BTLDataWnd/BTLDataWndV.xaml @@ -12,112 +12,112 @@ IsResizable="False" Title="BTLDataWndV" Name="BTLDataWndV"> - + diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb index 3a20cde9..2e4c4cf0 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb @@ -1580,6 +1580,8 @@ Public Class BTLPartVM If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then EgtResetCurrMachGroup() ResetSearchFound() + Map.refStatisticsTimePanelVM.ViewPage_Visibility = Visibility.Visible + Map.refStatisticsTimePanelVM.MachiningPage_Visibility = Visibility.Collapsed End If EgtDraw() NotifyPropertyChanged(NameOf(SelBTLFeatureVM)) diff --git a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb index 1cd33656..4b7539b5 100644 --- a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb @@ -598,6 +598,9 @@ Public Class CALCPanelVM ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then nProjType = Map.refProdManagerVM.nProdType sMachineName = If(Not IsNothing(ProjectManagerVM.CurrProd), ProjectManagerVM.CurrProd.sMachine, "") + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + nProjType = Map.refOnlyProdManagerVM.nProdType + sMachineName = If(Not IsNothing(ProjectManagerVM.CurrProd), ProjectManagerVM.CurrProd.sMachine, "") End If If nMachType = nProjType OrElse (nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj)) OrElse @@ -611,7 +614,7 @@ Public Class CALCPanelVM End If End If Next - Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso MachineList.Count > 1 AndAlso GetMainPrivateProfileInt(S_MACH, K_CHANGEMACH, 0) = 1) + Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso MachineList.Count > 1 AndAlso GetMainPrivateProfileInt(S_MACH, K_CHANGEMACH, 0) = 1) End Sub Friend Function IsMachineModified() As Boolean diff --git a/EgtBEAMWALL.ViewerOptimizer/ChangeMaterialWnd/ChangeMaterialWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/ChangeMaterialWnd/ChangeMaterialWndV.xaml index 6f236d7e..e9a6f786 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ChangeMaterialWnd/ChangeMaterialWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ChangeMaterialWnd/ChangeMaterialWndV.xaml @@ -1,17 +1,17 @@  - + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" + Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" + WindowStyle="None" ResizeMode="NoResize" + SizeToContent="WidthAndHeight" + WindowStartupLocation="CenterOwner" + IsClosable="False" + IsMinimizable="False" + IsResizable="False" + Title="ChangeMaterialWnd"> + diff --git a/EgtBEAMWALL.ViewerOptimizer/FeatureManager/FeatureManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/FeatureManager/FeatureManagerV.xaml index 27c3e618..7bc75e48 100644 --- a/EgtBEAMWALL.ViewerOptimizer/FeatureManager/FeatureManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/FeatureManager/FeatureManagerV.xaml @@ -25,8 +25,8 @@ Visibility="{Binding Priority_Visibility}" Style="{StaticResource OptionTextBlock}"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/FreeContourInput/FreeContourInputV.xaml b/EgtBEAMWALL.ViewerOptimizer/FreeContourInput/FreeContourInputV.xaml index 430fb0c8..d31388a3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/FreeContourInput/FreeContourInputV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/FreeContourInput/FreeContourInputV.xaml @@ -27,7 +27,7 @@ @@ -37,10 +37,10 @@ @@ -355,14 +355,14 @@ + Style="{StaticResource PartParam_TextBlock}"/> + Style="{StaticResource PartParam_TextBlock}"/> @@ -397,16 +397,16 @@ From ec20f9db1c949c671172bfc11ae7fdf4786807c8 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 20 Mar 2024 14:14:01 +0100 Subject: [PATCH 080/126] - aggiunto pulsante parametri macchina - aggiunto controllo su scelta macchina, nuova pagina --- .../Machine_ConfigurationPageV.xaml | 21 +++++++++---- .../MachinePanel/MachinePanelV.xaml | 4 +++ .../ConfigurationPage/ConfigurationPageVM.vb | 18 +++++++++-- .../MachinePanel/MachinePanelVM.vb | 27 +++++++++++++++++ .../Utility/Dictionary.xaml | 11 +++++++ .../CALCPanel/CALCPanelVM.vb | 20 ++++++++++--- .../ConfigurationPage/ConfigurationPageV.xaml | 4 +-- .../ConfigurationPage/ConfigurationPageVM.vb | 20 +++++++++---- .../FeatureListManagerVM.vb | 4 +-- .../MachinePanel/MachinePanelVM.vb | 30 +++++++++++++++++-- .../Utility/Dictionary.xaml | 11 +++++++ .../WarehouseWnd/WarehouseWndV.xaml | 20 ++++++------- 12 files changed, 156 insertions(+), 34 deletions(-) diff --git a/EgtBEAMWALL.Core/ConfigurationPage/Machine_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/Machine_ConfigurationPageV.xaml index 720cdea9..c250f67c 100644 --- a/EgtBEAMWALL.Core/ConfigurationPage/Machine_ConfigurationPageV.xaml +++ b/EgtBEAMWALL.Core/ConfigurationPage/Machine_ConfigurationPageV.xaml @@ -7,8 +7,6 @@ - - @@ -21,7 +19,7 @@ - + @@ -46,15 +44,17 @@ + Width="60"/> @@ -67,4 +67,13 @@ + + diff --git a/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml b/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml index a529c024..822304a0 100644 --- a/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml +++ b/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml @@ -40,6 +40,10 @@ Visibility="{Binding WallTable_Visibility}"> + + --> diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb index 7907ccdb..2bcd5417 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb @@ -37,27 +37,22 @@ Public Class ConfigurationPageVM If m_SelConfigSubPage = ConfigSubPages.GENERAL Then m_bGeneral_Visibility = Visibility.Visible m_bParameterQ_Visibility = Visibility.Collapsed - m_bMachine_Visibility = Visibility.Collapsed m_bPDFEditor_Visibility = Visibility.Collapsed ElseIf m_SelConfigSubPage = ConfigSubPages.QPARAMETERS Then m_bParameterQ_Visibility = Visibility.Visible m_bGeneral_Visibility = Visibility.Collapsed - m_bMachine_Visibility = Visibility.Collapsed m_bPDFEditor_Visibility = Visibility.Collapsed ElseIf m_SelConfigSubPage = ConfigSubPages.MACHINE Then - m_bMachine_Visibility = Visibility.Visible m_bGeneral_Visibility = Visibility.Collapsed m_bParameterQ_Visibility = Visibility.Collapsed m_bPDFEditor_Visibility = Visibility.Collapsed ElseIf m_SelConfigSubPage = ConfigSubPages.PDFEDITOR Then m_bPDFEditor_Visibility = Visibility.Visible - m_bMachine_Visibility = Visibility.Collapsed m_bGeneral_Visibility = Visibility.Collapsed m_bParameterQ_Visibility = Visibility.Collapsed End If NotifyPropertyChanged(NameOf(General_Visibility)) NotifyPropertyChanged(NameOf(ParameterQ_Visibility)) - NotifyPropertyChanged(NameOf(Machine_Visibility)) NotifyPropertyChanged(NameOf(PDFEditor_Visibility)) End Set End Property @@ -284,6 +279,17 @@ Public Class ConfigurationPageVM End Set End Property + Private m_MachineParameter_Visibility As Visibility = Visibility.Collapsed + Public Property MachineParameter_Visibility As Visibility + Get + Return m_MachineParameter_Visibility + End Get + Set(value As Visibility) + m_MachineParameter_Visibility = value + NotifyPropertyChanged(NameOf(MachineParameter_Visibility)) + End Set + End Property + ' Definizione comandi Private m_cmdSave As ICommand Private m_cmdChooseExternalBackupFolderPath As ICommand @@ -518,6 +524,10 @@ Public Class ConfigurationPageVM SelReminder = m_ReminderList.FirstOrDefault(Function(x) x.Id = nDefaultReminderFrequency) Dim nExternalBackupActive As Integer = GetMainPrivateProfileInt(S_BACKUPANDRESTORE, K_EXTERNALBACKUPACTIVE, 0) m_bExternalBackupActive = nExternalBackupActive > 0 + m_MachineParameter_Visibility = Visibility.Collapsed + m_bMachine_Visibility = Visibility.Collapsed + NotifyPropertyChanged(NameOf(MachineParameter_Visibility)) + NotifyPropertyChanged(NameOf(Machine_Visibility)) NotifyPropertyChanged(NameOf(bExternalBackupActive)) End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/FeatureListManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/FeatureListManagerVM.vb index 42525d5b..3ba89550 100644 --- a/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/FeatureListManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/FeatureListManagerVM.vb @@ -169,8 +169,8 @@ Public Class FeatureListManagerVM Private Sub CreateMacroTable() Dim nMacroW, nMacroH As Integer - If Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 0 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 180 Then - If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM) Then + If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM) Then + If Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 0 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 180 Then If Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 1 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 3 Then nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH diff --git a/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelVM.vb index 88351e28..92480652 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelVM.vb @@ -21,7 +21,7 @@ Public Class MachinePanelVM Set(value As Machine) If value IsNot m_SelectedMachine Then ' imposto macchina in DbGeometrico - If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) Then + If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then m_SelectedMachine = value End If ' Salvo impostazione macchina corrente @@ -92,7 +92,6 @@ Public Class MachinePanelVM End Get End Property - #Region "Messages" Public ReadOnly Property ToolDBMsg As String @@ -110,6 +109,11 @@ Public Class MachinePanelVM Return EgtMsg(MSG_ALARMSPAGEUC + 33) End Get End Property + Public ReadOnly Property ParameterMachineMsg As String + Get + Return EgtMsg(61778) + End Get + End Property #End Region ' Messages @@ -136,6 +140,7 @@ Public Class MachinePanelVM ' Definizione comandi Private m_cmdBeamTable As ICommand Private m_cmdWallTable As ICommand + Private m_cmdParameterMachine As ICommand #End Region 'FIELDS & PROPERTIES @@ -352,6 +357,27 @@ Public Class MachinePanelVM #End Region ' WallTable +#Region "ParameterMachine" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property ParameterMachine_Command As ICommand + Get + If m_cmdParameterMachine Is Nothing Then + m_cmdParameterMachine = New Command(AddressOf ParameterMachineVisibility) + End If + Return m_cmdParameterMachine + End Get + End Property + + Public Sub ParameterMachineVisibility() + Map.refConfigurationPageVM.MachineParameter_Visibility = Visibility.Visible + Map.refConfigurationPageVM.Machine_Visibility = Visibility.Visible + End Sub + +#End Region ' ParameterMachine + #End Region ' COMMANDS End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index e3b493b7..f484b4bc 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -176,6 +176,13 @@ + @@ -220,6 +227,10 @@ + diff --git a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndV.xaml index 025b0dbd..a87228b3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndV.xaml @@ -288,21 +288,21 @@ From bf521d11b3f42ce636f3a103a2c0d64f5f34d824 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 28 Mar 2024 16:05:44 +0100 Subject: [PATCH 081/126] -implementazione controllo su scelta macchina -gestito importazione progetto su nuova pagina --- .../CALCPanel/CALCPanelVM.vb | 30 ++-- .../MainWindow/MainWindowVM.vb | 2 +- .../OnlyProdManager/OnlyProdManagerVM.vb | 141 +++++++++--------- 3 files changed, 89 insertions(+), 84 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb index 010c13ff..b8ebdc18 100644 --- a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb @@ -1160,26 +1160,19 @@ Public Class CALCPanelVM ''' Execute the Open. This method is invoked by the OpenCommand. ''' Friend Sub Ok() - If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then - If MessageBox.Show(EgtMsg(61779), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then - ResetProject() - Else - SetChooseMachine_Visibility(False) - End If - ElseIf Map.refMainMenuVM.SelPage = Pages.VIEW Then - ResetProject() - End If - End Sub - - Private Sub ResetProject() ' aggiorno la Macchina selezionata nel Machine Panel e collasso CmBx e pulsante di conferma If Not IsNothing(SelectedMachine) Then Map.refMachinePanelVM.SelectedMachine = SelectedMachine m_IsMachineApplied = True SetChooseMachine_Visibility(False) ' resetto i parametri errori integration ciclando su ogni Part e per ogni Part ogni Feature - Dim ProjId = ProjectManagerVM.CurrProj.nProjId - Dim TempList As New List(Of BTLPartM) + Dim ProjId As Integer = GDB_ID.NULL + 'Dim TempList As New List(Of BTLPartM) Dim nPartId As Integer = EgtGetFirstPart() + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + EgtGetInfo(nPartId, PROJ, ProjId) + Else + ProjId = ProjectManagerVM.CurrProj.nProjId + End If While nPartId <> GDB_ID.NULL ' se devo filtrare un progetto If ProjId > 0 Then @@ -1223,6 +1216,15 @@ Public Class CALCPanelVM End If nPartId = EgtGetNextPart(nPartId) End While + ' Se OnlyProdPage rimuovo MachGroup + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then + If MessageBox.Show(EgtMsg(61779), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then + For Index As Integer = Map.refMachGroupPanelVM.MachGroupVMList.Count - 1 To 0 Step -1 + Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(Index) + CurrMachGroup.DeleteMachGroup() + Next + End If + End If ' rigenero struttura BTL Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjId)) End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb index 1f102675..fe77f736 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb @@ -194,7 +194,7 @@ Public Class MainWindowVM Integer.TryParse(sPjId, PjId) If Map.refMainWindowVM.MainWindowM.bOnlyProd Then Map.refOnlyProdManagerVM.SetCurrProd(PjId) - Map.refOnlyProdManagerVM.SetCurrProj(Map.refOnlyProdManagerVM.CurrProd.nProjIdList(0)) + If Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Map.refOnlyProdManagerVM.SetCurrProj(Map.refOnlyProdManagerVM.CurrProd.nProjIdList(0)) Else Map.refProjManagerVM.SetCurrProj(PjId) End If diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb index 8e1b5347..bfa454b3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb @@ -1585,6 +1585,8 @@ Public Class OnlyProdManagerVM Dim BTLInfoIdList As New List(Of Integer) Dim BTLFileNameList As New List(Of String) Dim CurrImportProjId As Integer + Dim nProdId As Integer = 0 + Dim sProdDir As String = "" Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) While nBTLInfoLayerId <> GDB_ID.NULL ' recupero il ProjId @@ -1696,83 +1698,84 @@ Public Class OnlyProdManagerVM CurrProd = Nothing ' carico Machgroup che non verrebbero altrimenti importati Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList())) - If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then - ' inizializzo nuovo progetto PROD - Dim nProdId As Integer = 0 - Dim sProdDir As String = "" - InitNewProd(NewProjIdList(0), nProdId, sProdDir) - ' setto il PType del Prod - DbControllers.m_ProdController.UpdatePType(nProdId, nType) - ' setto la Macchina associata al Prod - DbControllers.m_ProdController.UpdateMachine(nProdId, sMachine) - For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList - ' aggiorno ProdId sui MachGroup - EgtSetInfo(MachGroup.Id, MGR_RPT_PRODID, nProdId) - If Map.refMainWindowVM.MainWindowM.nUserLevel < 5 OrElse GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) <> 1 Then - ' resetto tutti gli stati di CALC - MachGroup.ResetCalcTotalMachGroup() + 'If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then + ' inizializzo nuovo progetto PROD + 'Dim nProdId As Integer = 0 + 'Dim sProdDir As String = "" + InitNewProd(NewProjIdList(0), nProdId, sProdDir) + ' setto il PType del Prod + DbControllers.m_ProdController.UpdatePType(nProdId, nType) + ' setto la Macchina associata al Prod + DbControllers.m_ProdController.UpdateMachine(nProdId, sMachine) + For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList + ' aggiorno ProdId sui MachGroup + EgtSetInfo(MachGroup.Id, MGR_RPT_PRODID, nProdId) + If Map.refMainWindowVM.MainWindowM.nUserLevel < 5 OrElse GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) <> 1 Then + ' resetto tutti gli stati di CALC + MachGroup.ResetCalcTotalMachGroup() + End If + Next + If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) = 1 Then + ' riporto info di futuro aggiornamento machgroup + nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) + While nBTLInfoLayerId <> GDB_ID.NULL + EgtSetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, True) + nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO) + End While + End If + ' salvo il progetto PROD + EgtSaveFile(sProjFromPath(0), NGE.CMPTEXT) + ' copio file progetto + Dim sProjPath As String = String.Empty + Dim sProdPath As String = sProdDir & "\" & nProdId.ToString("0000") & ".nge" + If EgtGetCurrFilePath(sProjPath) AndAlso Not String.IsNullOrEmpty(sProjPath) Then + Try + File.Copy(sProjPath, sProdPath) + 'Map.refSceneHostVM.MainController.OpenProject(sProdPath) + bOk = True + Catch ex As Exception + EgtOutLog("Impossibile copiare il file") + bOk = False + End Try + End If + If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) = 1 Then + ' copio tutti i bwe + For Each CurrFile In Directory.GetFiles(sProjectimportDir) + If Path.GetExtension(CurrFile) = ".bwe" OrElse Path.GetExtension(CurrFile) = ".html" Then + File.Copy(CurrFile, sProdDir & "\" & Path.GetFileName(CurrFile)) End If Next - If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) = 1 Then - ' riporto info di futuro aggiornamento machgroup - nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) - While nBTLInfoLayerId <> GDB_ID.NULL - EgtSetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, True) - nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO) - End While - End If - ' salvo il progetto PROD - EgtSaveFile(sProjFromPath(0), NGE.CMPTEXT) - ' copio file progetto - Dim sProjPath As String = String.Empty - Dim sProdPath As String = sProdDir & "\" & nProdId.ToString("0000") & ".nge" - If EgtGetCurrFilePath(sProjPath) AndAlso Not String.IsNullOrEmpty(sProjPath) Then - Try - File.Copy(sProjPath, sProdPath) - 'Map.refSceneHostVM.MainController.OpenProject(sProdPath) - bOk = True - Catch ex As Exception - EgtOutLog("Impossibile copiare il file") - bOk = False - End Try - End If - If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) = 1 Then - ' copio tutti i bwe - For Each CurrFile In Directory.GetFiles(sProjectimportDir) - If Path.GetExtension(CurrFile) = ".bwe" OrElse Path.GetExtension(CurrFile) = ".html" Then - File.Copy(CurrFile, sProdDir & "\" & Path.GetFileName(CurrFile)) - End If - Next - End If - If bOk Then - ' aggiungo altri proj a prod - For Each nProjId In NewProjIdList - DbControllers.m_ProdController.AddProj(nProdId, nProjId, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) - Next - Else - ' elimino da DB - DbControllers.m_ProdController.DeleteProd(nProdId, True) - End If - Dim MyMachGroupList As New List(Of MyMachGroupM) - If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then - For Each MachGroup In Map.refProjectVM.MachGroupPanelVM.m_MyMachGroupPanelM.MachGroupMList - MyMachGroupList.Add(MachGroup) - Next - End If - ' aggiorno pezzi su Db - DbControllers.m_ProdController.UpdateMachGroup(nProdId, MyMachGroupList) - ' resetto lock - DbControllers.m_ProdController.LockByProdId(nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) End If - DbControllers.m_ProdController.ResetController() + If bOk Then + ' aggiungo altri proj a prod + For Each nProjId In NewProjIdList + DbControllers.m_ProdController.AddProj(nProdId, nProjId, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + Next + Else + ' elimino da DB + DbControllers.m_ProdController.DeleteProd(nProdId, True) + End If + Dim MyMachGroupList As New List(Of MyMachGroupM) + If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then + For Each MachGroup In Map.refProjectVM.MachGroupPanelVM.m_MyMachGroupPanelM.MachGroupMList + MyMachGroupList.Add(MachGroup) + Next + End If + ' aggiorno pezzi su Db + DbControllers.m_ProdController.UpdateMachGroup(nProdId, MyMachGroupList) + ' resetto lock + DbControllers.m_ProdController.LockByProdId(nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) End If + DbControllers.m_ProdController.ResetController() + 'End If ' imposto progetto corrente If NewProjIdList.Count > 0 Then SetCurrProj(NewProjIdList(0)) - OpenProject(TempCurrProd) ' Da controllare + SetCurrProd(nProdId) + OpenProject(CurrProd) ' Da controllare End If - ' ripristino eventuale CurrProd precedente - CurrProd = TempCurrProd + '' ripristino eventuale CurrProd precedente + 'CurrProd = TempCurrProd WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, Path.GetDirectoryName(ImportDlg.FileName)) LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT) End Sub From f43fac953e5f19fc2bc8ac6ff86d00e28d077e77 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 29 Mar 2024 17:28:15 +0100 Subject: [PATCH 082/126] -aggiunto rimozione machgroup su scelta macchina onlyprodpage --- EgtBEAMWALL.Core/ProjectFileVM/ProjFileM.vb | 36 +++++++++---------- .../CALCPanel/CALCPanelVM.vb | 22 ++++++------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/EgtBEAMWALL.Core/ProjectFileVM/ProjFileM.vb b/EgtBEAMWALL.Core/ProjectFileVM/ProjFileM.vb index c42731b8..7eeedb4b 100644 --- a/EgtBEAMWALL.Core/ProjectFileVM/ProjFileM.vb +++ b/EgtBEAMWALL.Core/ProjectFileVM/ProjFileM.vb @@ -19,28 +19,28 @@ Public Class ProjFileM End Property Protected m_sBTLFileName As String = String.Empty - Public Property sBTLFileName As String - Get - Return m_sBTLFileName - End Get - Set(value As String) - m_sBTLFileName = value - End Set - End Property + Public Property sBTLFileName As String + Get + Return m_sBTLFileName + End Get + Set(value As String) + m_sBTLFileName = value + End Set + End Property - Protected m_sDescription As String = String.Empty - Public Property sDescription As String - Get - Return m_sDescription - End Get - Set(value As String) - m_sDescription = value - End Set - End Property + Protected m_sDescription As String = String.Empty + Public Property sDescription As String + Get + Return m_sDescription + End Get + Set(value As String) + m_sDescription = value + End Set + End Property #Region "CONSTRUCTORS" - Protected Sub New() + Protected Sub New() End Sub Public Shared Function CreateNewProjFileM() As ProjFileM diff --git a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb index b8ebdc18..df776a4b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb @@ -1165,21 +1165,17 @@ Public Class CALCPanelVM m_IsMachineApplied = True SetChooseMachine_Visibility(False) ' resetto i parametri errori integration ciclando su ogni Part e per ogni Part ogni Feature - Dim ProjId As Integer = GDB_ID.NULL + Dim ProjId As Integer + Dim nPartProjId As Integer 'Dim TempList As New List(Of BTLPartM) Dim nPartId As Integer = EgtGetFirstPart() - If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then - EgtGetInfo(nPartId, PROJ, ProjId) - Else - ProjId = ProjectManagerVM.CurrProj.nProjId - End If + ProjId = ProjectManagerVM.CurrProj.nProjId + EgtGetInfo(nPartId, BTL_PRT_PROJ, nPartProjId) While nPartId <> GDB_ID.NULL ' se devo filtrare un progetto - If ProjId > 0 Then + If ProjId > 0 OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then ' verifico se il pezzo appartiene al ProjId - Dim nPartProjId As Integer - EgtGetInfo(nPartId, BTL_PRT_PROJ, nPartProjId) - If nPartProjId = ProjId Then + If nPartProjId = ProjId OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then EgtRemoveInfo(nPartId, ITG_PROJ_ERR) EgtRemoveInfo(nPartId, ITG_PROJ_MSG) EgtRemoveInfo(nPartId, ITG_PROJ_ROT) @@ -1226,7 +1222,11 @@ Public Class CALCPanelVM End If End If ' rigenero struttura BTL - Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjId)) + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(nPartProjId)) + Else + Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjId)) + End If End Sub #End Region ' Ok From e2f9d0f508164096845a80ca3a0d64190bcf21ec Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 5 Apr 2024 09:07:00 +0200 Subject: [PATCH 083/126] -aggiornato gestione visualizzazione pdf e pdf preview --- .../Statistics/PDFHelper.vb | 313 +++++------------- 1 file changed, 92 insertions(+), 221 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb index 900a5d79..221a1cae 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb @@ -106,8 +106,8 @@ Module PDFHelper Dim pgSetup As PageSetup = document.DefaultPageSetup.Clone() pgSetup.Orientation = Orientation.Landscape section.PageSetup = pgSetup - Dim paragraph As Paragraph = section.AddParagraph("Part Totals", "Heading2") - paragraph.Format.SpaceBefore = "3.0cm" + Dim paragraph As Paragraph = section.AddParagraph(EgtMsg(61734) & "s", "Heading2") + paragraph.Format.SpaceBefore = "3.5cm" Dim sPartTot As ExpanderPDF = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61734)) ' Recupero lista Part Totals Dim sBTLTotParts As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61716)) ' Recupero Numero totale pezzi con relativo checkbox Dim sBTLTotVolume As ExpanderElement = sPartTot.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61717)) ' Recupero Volume totale con relativo checkbox @@ -125,8 +125,8 @@ Module PDFHelper Dim pgSetup As PageSetup = document.DefaultPageSetup.Clone() pgSetup.Orientation = Orientation.Landscape section.PageSetup = pgSetup - Dim paragraph As Paragraph = section.AddParagraph("Machgroup Totals", "Heading2") - paragraph.Format.SpaceBefore = "3.0cm" + Dim paragraph As Paragraph = section.AddParagraph(EgtMsg(61729), "Heading2") + paragraph.Format.SpaceBefore = "3.5cm" Dim sMachGroup As ExpanderPDF = Map.refPDFEditorVM.ExpanderList.FirstOrDefault(Function(x) x.sNameCategory = EgtMsg(61729)) ' Recupero lista Machgroup Totals Dim sNumberBlanks As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61721)) ' Recupero Numero di grezzi con relativo checkbox Dim sTotalVolume As ExpanderElement = sMachGroup.ExpanderElementList.FirstOrDefault(Function(x As ExpanderElement) x.sNameParameter = EgtMsg(61717)) ' Recupero Volume totale con relativo checkbox @@ -185,11 +185,11 @@ Module PDFHelper Dim countItemList As Integer = 0 Select Case nListType Case ListTypes.PART - section.AddParagraph("Part List", "Heading2") + section.AddParagraph(EgtMsg(61733), "Heading2") Case ListTypes.MACHGROUP - section.AddParagraph("MachGroup List", "Heading2") + section.AddParagraph(EgtMsg(61730), "Heading2") Case ListTypes.RAWPART - section.AddParagraph("RawPart List", "Heading2") + section.AddParagraph(EgtMsg(61732), "Heading2") End Select Dim table As Table = New Table() table.Borders.Width = 0.75 @@ -277,11 +277,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.PDN_Msg) ElseIf nListType = ListTypes.PART Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph(1) - Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nPDN) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, 1, BTLPartVM.nPDN)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -307,35 +303,27 @@ Module PDFHelper ' row.Cells(ColumnIndex).AddParagraph(RawPart.sW) 'End If - If nListType = ListTypes.PART AndAlso sW.bIsChecked Then + If sW.bIsChecked Then If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1)) + Select Case nListType + Case ListTypes.PART + table.AddColumn(Unit.FromCentimeter(1)) + Case ListTypes.MACHGROUP, ListTypes.RAWPART + table.AddColumn(Unit.FromCentimeter(2)) + End Select ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.W_Msg) ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(200) + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, 200, 120)) Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sW) - End If - ElseIf nListType = ListTypes.MACHGROUP AndAlso sW.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.W_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(120) - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dW) - End If - ElseIf nListType = ListTypes.RAWPART AndAlso sW.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.W_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(120) - Else - row.Cells(ColumnIndex).AddParagraph(RawPart.sW) + Select Case nListType + Case ListTypes.PART + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sW) + Case ListTypes.MACHGROUP + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dW) + Case ListTypes.RAWPART + row.Cells(ColumnIndex).AddParagraph(RawPart.sW) + End Select End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -353,35 +341,27 @@ Module PDFHelper ' row.Cells(ColumnIndex).AddParagraph(RawPart.sH) 'End If - If nListType = ListTypes.PART AndAlso sH.bIsChecked Then + If sH.bIsChecked Then If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1)) + Select Case nListType + Case ListTypes.PART + table.AddColumn(Unit.FromCentimeter(1)) + Case ListTypes.MACHGROUP, ListTypes.RAWPART + table.AddColumn(Unit.FromCentimeter(2)) + End Select ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.H_Msg) ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(360) + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, 360, 160)) Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sH) - End If - ElseIf nListType = ListTypes.MACHGROUP AndAlso sH.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.H_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(160) - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dH) - End If - ElseIf nListType = ListTypes.RAWPART AndAlso sH.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.H_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(160) - Else - row.Cells(ColumnIndex).AddParagraph(RawPart.sH) + Select Case nListType + Case ListTypes.PART + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sH) + Case ListTypes.MACHGROUP + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dH) + Case ListTypes.RAWPART + row.Cells(ColumnIndex).AddParagraph(RawPart.sH) + End Select End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -399,35 +379,27 @@ Module PDFHelper ' row.Cells(ColumnIndex).AddParagraph(RawPart.sL) 'End If - If nListType = ListTypes.PART AndAlso sL.bIsChecked Then + If sL.bIsChecked Then If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1.6)) + Select Case nListType + Case ListTypes.PART + table.AddColumn(Unit.FromCentimeter(1.6)) + Case ListTypes.MACHGROUP, ListTypes.RAWPART + table.AddColumn(Unit.FromCentimeter(2)) + End Select ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.L_Msg) ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(6672.6) + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, 6672.6, 15000)) Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sL) - End If - ElseIf nListType = ListTypes.MACHGROUP AndAlso sL.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.L_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(15000) - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dL) - End If - ElseIf nListType = ListTypes.RAWPART AndAlso sL.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.L_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(15000) - Else - row.Cells(ColumnIndex).AddParagraph(RawPart.sL) + Select Case nListType + Case ListTypes.PART + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sL) + Case ListTypes.MACHGROUP + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dL) + Case ListTypes.RAWPART + row.Cells(ColumnIndex).AddParagraph(RawPart.sL) + End Select End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -443,25 +415,15 @@ Module PDFHelper ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) 'End If - If nListType = ListTypes.PART AndAlso sDesc.bIsChecked Then + If sDesc.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(4)) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.NAM_Msg) ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph("Arc.in salita smussato") + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, "Arc.in salita smussato", 1)) Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sNAM) - End If - ElseIf nListType = ListTypes.MACHGROUP AndAlso sDesc.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(4)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.NAM_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(1) - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, BTLPartVM.sNAM, MachGroupVM.nName)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -477,25 +439,15 @@ Module PDFHelper ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) 'End If - If nListType = ListTypes.PART AndAlso sName.bIsChecked Then + If sName.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(4)) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.NAM_Msg) ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph("Arc.in salita smussato") + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, "Arc.in salita smussato", 1)) Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sNAM) - End If - ElseIf nListType = ListTypes.MACHGROUP AndAlso sName.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(4)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.NAM_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(1) - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.nName) + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, BTLPartVM.sNAM, MachGroupVM.nName)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -513,7 +465,7 @@ Module PDFHelper ' row.Cells(ColumnIndex).AddParagraph(RawPart.sMaterial) 'End If - If nListType = ListTypes.PART AndAlso sMaterial.bIsChecked Then + If sMaterial.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2)) ElseIf PartIndex = -1 Then @@ -521,27 +473,14 @@ Module PDFHelper ElseIf bPreview Then row.Cells(ColumnIndex).AddParagraph("GL24h") Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sMATERIAL) - End If - ElseIf nListType = ListTypes.MACHGROUP AndAlso sMaterial.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.MAT_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph("GL24h") - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sMATERIAL) - End If - ElseIf nListType = ListTypes.RAWPART AndAlso sMaterial.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.MAT_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph("GL24h") - Else - row.Cells(ColumnIndex).AddParagraph(RawPart.sMaterial) + Select Case nListType + Case ListTypes.PART + row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sMATERIAL) + Case ListTypes.MACHGROUP + row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sMATERIAL) + Case ListTypes.RAWPART + row.Cells(ColumnIndex).AddParagraph(RawPart.sMaterial) + End Select End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -553,11 +492,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.CNT_Msg) ElseIf nListType = ListTypes.PART Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph(1) - Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sCNT) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, 1, BTLPartVM.sCNT)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -569,11 +504,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.ADDED_Msg) ElseIf nListType = ListTypes.PART Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph(0) - Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sADDED) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, 0, BTLPartVM.sADDED)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -585,11 +516,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.INPROD_Msg) ElseIf nListType = ListTypes.PART Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph(0) - Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nINPROD) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, 0, BTLPartVM.nINPROD)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -601,11 +528,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.DONE_Msg) ElseIf nListType = ListTypes.PART Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph(0) - Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.nDONE) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, 0, BTLPartVM.nDONE)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -617,11 +540,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.Used_Msg) ElseIf nListType = ListTypes.MACHGROUP Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph(99.719) - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sUsage) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, 99.719, MachGroupVM.sUsage)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -633,11 +552,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.Waste_Msg) ElseIf nListType = ListTypes.MACHGROUP Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph(0.5) - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sWaste) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, 0.5, MachGroupVM.sWaste)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -653,25 +568,15 @@ Module PDFHelper ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dUnitVolume) 'End If - If nListType = ListTypes.PART AndAlso sUVolume.bIsChecked Then + If sUVolume.bIsChecked Then If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(1.5)) + table.AddColumn(If(nListType = ListTypes.PART, Unit.FromCentimeter(1.5), Unit.FromCentimeter(2))) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.UNIT_VOLUME_Msg) ElseIf bPreview Then row.Cells(ColumnIndex).AddParagraph(0.48) Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sUnitVolume) - End If - ElseIf nListType = ListTypes.MACHGROUP AndAlso sUVolume.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.UNIT_VOLUME_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph(0.48) - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.dUnitVolume) + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, BTLPartVM.sUnitVolume, MachGroupVM.dUnitVolume)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -683,11 +588,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.TOT_VOLUME_Msg) ElseIf nListType = ListTypes.PART Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph(0.48) - Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sTotVolume) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, 0.48, BTLPartVM.sTotVolume)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -703,25 +604,15 @@ Module PDFHelper ' row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sUnitTime) 'End If - If nListType = ListTypes.PART AndAlso sUTime.bIsChecked Then + If sUTime.bIsChecked Then If PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(2.2)) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.UNIT_TIME_Msg) ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph("00:00:00") + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, "00:00:00", "00:13:07")) Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sUnitTime) - End If - ElseIf nListType = ListTypes.MACHGROUP AndAlso sUTime.bIsChecked Then - If PartIndex = -2 Then - table.AddColumn(Unit.FromCentimeter(2.2)) - ElseIf PartIndex = -1 Then - row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.UNIT_TIME_Msg) - ElseIf bPreview Then - row.Cells(ColumnIndex).AddParagraph("00:13:07") - Else - row.Cells(ColumnIndex).AddParagraph(MachGroupVM.sUnitTime) + row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, BTLPartVM.sUnitTime, MachGroupVM.sUnitTime)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -733,11 +624,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.TOT_TIME_Msg) ElseIf nListType = ListTypes.PART Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph("00:00:00") - Else - row.Cells(ColumnIndex).AddParagraph(BTLPartVM.sTotTime) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, "00:00:00", BTLPartVM.sTotTime)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -749,11 +636,7 @@ Module PDFHelper ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.QTY_Msg) ElseIf nListType = ListTypes.RAWPART Then - If bPreview Then - row.Cells(ColumnIndex).AddParagraph(11) - Else - row.Cells(ColumnIndex).AddParagraph(RawPart.nQuantity) - End If + row.Cells(ColumnIndex).AddParagraph(If(bPreview, 11, RawPart.nQuantity)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -845,10 +728,8 @@ Module PDFHelper table.AddColumn(Unit.FromCentimeter(1.5)) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.PDN_Msg) - ElseIf IsNothing(RawPart) Then - row.Cells(ColumnIndex).AddParagraph(55) Else - row.Cells(ColumnIndex).AddParagraph(PartVM.nPDN) + row.Cells(ColumnIndex).AddParagraph(If(IsNothing(RawPart), 55, PartVM.nPDN)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -859,10 +740,8 @@ Module PDFHelper table.AddColumn(Unit.FromCentimeter(2)) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.W_Msg) - ElseIf IsNothing(RawPart) Then - row.Cells(ColumnIndex).AddParagraph(120) Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sW) + row.Cells(ColumnIndex).AddParagraph(If(IsNothing(RawPart), 120, PartVM.sW)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -873,10 +752,8 @@ Module PDFHelper table.AddColumn(Unit.FromCentimeter(2)) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.H_Msg) - ElseIf IsNothing(RawPart) Then - row.Cells(ColumnIndex).AddParagraph(160) Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sH) + row.Cells(ColumnIndex).AddParagraph(If(IsNothing(RawPart), 160, PartVM.sH)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -887,10 +764,8 @@ Module PDFHelper table.AddColumn(Unit.FromCentimeter(2)) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.L_Msg) - ElseIf IsNothing(RawPart) Then - row.Cells(ColumnIndex).AddParagraph(185.9) Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sL) + row.Cells(ColumnIndex).AddParagraph(If(IsNothing(RawPart), 185.9, PartVM.sL)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -901,10 +776,8 @@ Module PDFHelper table.AddColumn(Unit.FromCentimeter(4)) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.NAM_Msg) - ElseIf IsNothing(RawPart) Then - row.Cells(ColumnIndex).AddParagraph("Correntini") Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sNAM) + row.Cells(ColumnIndex).AddParagraph(If(IsNothing(RawPart), "Correntini", PartVM.sNAM)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) @@ -923,10 +796,8 @@ Module PDFHelper table.AddColumn(Unit.FromCentimeter(2)) ElseIf PartIndex = -1 Then row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.MAT_Msg) - ElseIf IsNothing(RawPart) Then - row.Cells(ColumnIndex).AddParagraph("GL24h") Else - row.Cells(ColumnIndex).AddParagraph(PartVM.sMATERIAL) + row.Cells(ColumnIndex).AddParagraph(If(IsNothing(RawPart), "GL24h", PartVM.sMATERIAL)) End If ElseIf PartIndex = -2 Then table.AddColumn(Unit.FromCentimeter(0)) From 088b9ce3cf9304dbc8ea007fc7066e0802825cc9 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 5 Apr 2024 17:01:25 +0200 Subject: [PATCH 084/126] =?UTF-8?q?-aggiunto=20selezione=20checkbox=20Feat?= =?UTF-8?q?ureInPartInRawPartListVM=20-istemata=20visibilit=C3=A0=20sp?= =?UTF-8?q?=C3=A8ecial=20panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 7 ++ .../ItemParamList/BTLPartListV.xaml | 18 +++- .../FeatureInPartInRawPartListV.xaml | 2 +- .../FeatureInPartInRawPartListVM.vb | 32 ++++++ .../OnlyProdFeatureInPartInRawPartListV.xaml | 102 ++++++++++++++++++ ...nlyProdFeatureInPartInRawPartListV.xaml.vb | 16 +++ .../ItemParamList/OnlyProdFeatureListV.xaml | 19 ++-- .../OnlyProdQParameterListV.xaml.vb | 1 - .../OnlyProdProject/OnlyProdProjectV.xaml | 2 +- .../TabWnd/ProdWndV.xaml | 10 +- 10 files changed, 190 insertions(+), 19 deletions(-) create mode 100644 EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index 49bc8a61..a1763412 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -198,6 +198,9 @@ FeatureListManagerV.xaml + + OnlyProdFeatureInPartInRawPartListV.xaml + NewMacroFeatureWnd.xaml @@ -487,6 +490,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml index 76b99bfc..799603b8 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml @@ -143,13 +143,27 @@ - - + --> + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml index 7dbd0b0a..582e75cf 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml @@ -10,7 +10,7 @@ --> bTemp Then Return Nothing + Next + Return bTemp + End Get + Set(value As Boolean?) + If Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList.Count = 0 Then + NotifyPropertyChanged(NameOf(bDOALL)) + Return + End If + ' imposto modalita' update multiplo + BTLFeatureVM.bDO_MultipleUpdate = True + For FeatureIndex = 0 To Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList.Count - 1 + If FeatureIndex = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList.Count - 1 Then + ' reset modalita' update multiplo + BTLFeatureVM.bDO_MultipleUpdate = False + End If + Dim Feature As BTLFeatureVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList(FeatureIndex) + Feature.bDO = value + Next + End Set + End Property + #Region "Messages" Public ReadOnly Property Description_Msg As String @@ -58,6 +88,8 @@ Public Class FeatureInPartInRawPartListVM ' recupero riferimento a colonna Do m_colFeatureInPartInRawPart_Do = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DO) m_colFeatureInPartInRawPart_Priority = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PRIORITY) + ' Aggiorno check DOALL + NotifyPropertyChanged(NameOf(bDOALL)) End Sub Friend Sub UpdateColumns(nMachType As MachineType) diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml new file mode 100644 index 00000000..75672dfe --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb new file mode 100644 index 00000000..0b0c2373 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb @@ -0,0 +1,16 @@ +Imports EgtBEAMWALL.Core + +Public Class OnlyProdFeatureInPartInRawPartListV + + ' funzione che impedisce di editare le righe che sono gia' in produzione + Private Sub FeatureInPartInRawPartList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs) + If IsNothing(e.Row) Then Return + Dim RowVM As BTLFeatureVM = DirectCast(e.Row.DataContext, BTLFeatureVM) + ' se in produzione impedisco modifica dei parametri + If DirectCast(RowVM.BTLFeatureM.ParentPart, PartM).nProductionState > ItemState.ND Then + 'For Each cell In Row.Item + e.Cancel = True + End If + End Sub + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml index 835b8830..eb599244 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml @@ -19,19 +19,20 @@ Style="{StaticResource DataGrid_CustomHighLight}"> - - - + + - - - + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml.vb index 5f61e0d5..ab7b55d5 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml.vb @@ -1,5 +1,4 @@ Imports EgtBEAMWALL.Core -Imports EgtBEAMWALL.Core.ConstGen Public Class OnlyProdQParameterListV diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml index 2a34ebfe..9ff46053 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml @@ -47,7 +47,7 @@ + Visibility="{Binding DataContext.SpecialPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProdWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProdWndV.xaml index 491ac70f..9ef5a0e1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProdWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProdWndV.xaml @@ -27,16 +27,16 @@ - + - + Date: Mon, 8 Apr 2024 16:22:52 +0200 Subject: [PATCH 085/126] -creazione finestre per nuova grafica pagina nuova --- .../OnlyProdGeneral_ConfigurationPageV.xaml | 118 +++++++++ ...OnlyProdGeneral_ConfigurationPageV.xaml.vb | 3 + .../OnlyProdMachine_ConfigurationPageV.xaml | 79 ++++++ ...OnlyProdMachine_ConfigurationPageV.xaml.vb | 3 + ...OnlyProdQParameter_ConfigurationPageV.xaml | 80 ++++++ ...yProdQParameter_ConfigurationPageV.xaml.vb | 3 + EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj | 21 ++ EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb | 2 + .../BTLPartList/OnlyProdBTLPartListV.xaml | 236 ++++++++++++++++++ .../BTLPartList/OnlyProdBTLPartListV.xaml.vb | 137 ++++++++++ .../OnlyProdBTLPartManagerV.xaml | 79 ++++++ .../OnlyProdBTLPartManagerV.xaml.vb | 3 + .../CALCPanel/OnlyProdCalcPanelV.xaml | 69 +++++ .../CALCPanel/OnlyProdCalcPanelV.xaml.vb | 3 + .../OnlyProdConfigurationPageV.xaml | 82 ++++++ .../OnlyProdConfigurationPageV.xaml.vb | 3 + .../EgtBEAMWALL.ViewerOptimizer.vbproj | 133 ++++++++++ .../OnlyProdFeatureListManagerV.xaml | 37 +++ .../OnlyProdFeatureListManagerV.xaml.vb | 3 + .../OnlyProdFeatureManagerV.xaml | 49 ++++ .../OnlyProdFeatureManagerV.xaml.vb | 3 + .../OnlyProdFreeContourInputV.xaml | 45 ++++ .../OnlyProdFreeContourInputV.xaml.vb | 3 + .../OnlyProdFreeContourManagerV.xaml | 70 ++++++ .../OnlyProdFreeContourManagerV.xaml.vb | 3 + .../InstrumentPanel/InstrumentPanelV.xaml | 4 +- .../OnlyProdInstrumentPanelV.xaml | 54 ++++ .../OnlyProdInstrumentPanelV.xaml.vb | 3 + .../OnlyProdFeatureInPartInRawPartListV.xaml | 13 +- ...nlyProdFeatureInPartInRawPartListV.xaml.vb | 9 + .../OnlyProdPartInRawPartListV.xaml | 232 +++++++++++++++++ .../OnlyProdPartInRawPartListV.xaml.vb | 29 +++ .../ItemParamList/OnlyProdRawPartListV.xaml | 183 ++++++++++++++ .../OnlyProdRawPartListV.xaml.vb | 28 +++ .../LeftPanel/OnlyProdLeftPanelV.xaml | 8 +- .../OnlyProdProject/OnlyProdProjectV.xaml | 24 +- .../OnlyProdPartInRawPartManagerV.xaml | 35 +++ .../OnlyProdPartInRawPartManagerV.xaml.vb | 3 + .../PartInRawPartManagerWndV.xaml | 10 +- .../PartManager/OnlyProdPartManagerV.xaml | 108 ++++++++ .../PartManager/OnlyProdPartManagerV.xaml.vb | 3 + .../OnlyProdRawPartManagerV.xaml | 48 ++++ .../OnlyProdRawPartManagerV.xaml.vb | 3 + .../RawPartManager/RawPartManagerWndV.xaml | 8 +- .../SceneHost/SceneHostV.xaml | 6 +- .../ShowBeamPanel/OnlyProdShowBeamPanelV.xaml | 28 +++ .../OnlyProdShowBeamPanelV.xaml.vb | 3 + .../ShowPanel/OnlyProdShowPanelV.xaml | 25 ++ .../ShowPanel/OnlyProdShowPanelV.xaml.vb | 3 + .../SpecialPanel/OnlyProdSpecialPanelV.xaml | 24 ++ .../OnlyProdSpecialPanelV.xaml.vb | 3 + .../OnlyProdStatisticsTimePanelV.xaml | 62 +++++ .../OnlyProdStatisticsTimePanelV.xaml.vb | 3 + .../TabWnd/ProjWndV.xaml | 16 +- .../ViewPanel/OnlyProdViewPanelV.xaml | 44 ++++ .../ViewPanel/OnlyProdViewPanelV.xaml.vb | 3 + 56 files changed, 2246 insertions(+), 46 deletions(-) create mode 100644 EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml create mode 100644 EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml.vb create mode 100644 EgtBEAMWALL.Core/ConfigurationPage/OnlyProdMachine_ConfigurationPageV.xaml create mode 100644 EgtBEAMWALL.Core/ConfigurationPage/OnlyProdMachine_ConfigurationPageV.xaml.vb create mode 100644 EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml create mode 100644 EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/CALCPanel/OnlyProdCalcPanelV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/CALCPanel/OnlyProdCalcPanelV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/FeatureManager/OnlyProdFeatureManagerV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/FeatureManager/OnlyProdFeatureManagerV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/FreeContourInput/OnlyProdFreeContourInputV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/FreeContourInput/OnlyProdFreeContourInputV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/FreeContourManager/OnlyProdFreeContourManagerV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/FreeContourManager/OnlyProdFreeContourManagerV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/PartManager/OnlyProdPartManagerV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/PartManager/OnlyProdPartManagerV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/ViewPanel/OnlyProdViewPanelV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/ViewPanel/OnlyProdViewPanelV.xaml.vb diff --git a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml new file mode 100644 index 00000000..081a6cd3 --- /dev/null +++ b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdMachine_ConfigurationPageV.xaml.vb b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdMachine_ConfigurationPageV.xaml.vb new file mode 100644 index 00000000..e543003f --- /dev/null +++ b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdMachine_ConfigurationPageV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdMachine_ConfigurationPageV + +End Class \ No newline at end of file diff --git a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml new file mode 100644 index 00000000..301d3bdc --- /dev/null +++ b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml.vb b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml.vb new file mode 100644 index 00000000..c99af9c6 --- /dev/null +++ b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdQParameter_ConfigurationPageV + +End Class \ No newline at end of file diff --git a/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj b/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj index ea729f35..2402341c 100644 --- a/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj +++ b/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj @@ -83,12 +83,21 @@ + + OnlyProdMachine_ConfigurationPageV.xaml + + + OnlyProdGeneral_ConfigurationPageV.xaml + General_ConfigurationPageV.xaml Machine_ConfigurationPageV.xaml + + OnlyProdQParameter_ConfigurationPageV.xaml + QParameter_ConfigurationPageV.xaml @@ -211,6 +220,14 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + Designer XamlIntelliSenseFileGenerator @@ -219,6 +236,10 @@ Designer XamlIntelliSenseFileGenerator + + MSBuild:Compile + Designer + Designer XamlIntelliSenseFileGenerator diff --git a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb index 2240b4e7..2cb43c91 100644 --- a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb @@ -6,6 +6,8 @@ Imports System.Windows.Input Imports System.Windows.Media Imports EgtUILib Imports EgtWPFLib5 +Imports EgtBEAMWALL.Core +Imports System.Windows.Threading Public MustInherit Class PartVM Inherits VMBase diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml new file mode 100644 index 00000000..fc40db4d --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml.vb new file mode 100644 index 00000000..b9adf072 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml.vb @@ -0,0 +1,137 @@ +Imports System.Reflection +Imports EgtBEAMWALL.Core.ConstGen + +Public Class OnlyProdBTLPartListV + + Private m_BTLPartListVM As BTLPartListVM + + Private m_SelectBtn As MouseButton = MouseButton.Left + Private m_HighlightBtn As MouseButton = MouseButton.Right + + Private m_NameDataGridType As Type + Private s_isDraggingSelectionField As FieldInfo + Private s_endDraggingMethod As MethodInfo + + Sub New() + ' This call is required by the designer. + InitializeComponent() + ' Add any initialization after the InitializeComponent() call. + m_BTLPartListVM = DataContext + m_NameDataGridType = BTLPart_DataGrid.GetType() + s_isDraggingSelectionField = m_NameDataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic) + s_endDraggingMethod = m_NameDataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic) + SetSelButton(MouseButton.Right) + End Sub + + Public Sub SetSelButton(SelButton As MouseButton) + Select Case SelButton + Case MouseButton.Right + m_SelectBtn = MouseButton.Right + m_HighlightBtn = MouseButton.Left + Case Else ' MouseButton.Left + m_SelectBtn = MouseButton.Left + m_HighlightBtn = MouseButton.Right + End Select + End Sub + + Public Sub DataGrid_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + If e.ChangedButton = MouseButton.Left Then + If e.ChangedButton = m_SelectBtn Then + If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then + e.Handled = True + Else + Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.SELECT_) + End If + ElseIf e.ChangedButton = m_HighlightBtn AndAlso (Map.refProjectVM.BTLStructureVM.SelectionType = BTLStructureVM.SelectionTypes.SELECT_ AndAlso + ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control)) Then + e.Handled = True + ElseIf e.ChangedButton = m_HighlightBtn Then + Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT) + End If + ' imposto tipo di grid selezionata + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PARTLIST) + End If + End Sub + + Public Sub DataGrid_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) + If e.ChangedButton = MouseButton.Right Then + If e.ChangedButton = m_SelectBtn Then + If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then + e.Handled = True + Else + Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.SELECT_) + End If + ElseIf e.ChangedButton = m_HighlightBtn Then + Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT) + End If + ' imposto tipo di grid selezionata + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PART) + End If + End Sub + + Public Shared Function FindVisualParent(Of T As DependencyObject)(ByVal child As DependencyObject) As T + Dim parentObject As DependencyObject = VisualTreeHelper.GetParent(child) + If parentObject Is Nothing Then Return Nothing + Dim parent As T = TryCast(parentObject, T) + + If parent IsNot Nothing Then + Return parent + Else + Return FindVisualParent(Of T)(parentObject) + End If + End Function + + Public Sub DataGrid_PreviewMouseMove(sender As Object, e As MouseEventArgs) + If m_SelectBtn = MouseButton.Left AndAlso e.LeftButton = MouseButtonState.Pressed Then + If CBool(If(s_isDraggingSelectionField?.GetValue(BTLPart_DataGrid), False)) Then s_endDraggingMethod.Invoke(BTLPart_DataGrid, New Object(-1) {}) + End If + End Sub + + Private Sub PartList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + If TypeOf sender Is DataGridRow Then + Dim Row As DataGridRow = DirectCast(sender, DataGridRow) + If Not Row.IsSelected Then Return + Select Case e.ChangedButton + Case MouseButton.Left + If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then + Return + Else + BTLPart_DataGrid.SelectedItem = Nothing + BTLPart_DataGrid.SelectedItem = Row.DataContext + End If + + Case MouseButton.Right + + + End Select + End If + End Sub + + Private Sub PartList_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) + If TypeOf sender Is DataGridRow Then + Dim Row As DataGridRow = DirectCast(sender, DataGridRow) + If Not Row.IsSelected Then Return + Select Case e.ChangedButton + Case MouseButton.Right + If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then + Row.IsSelected = Not Row.IsSelected + Else + BTLPart_DataGrid.SelectedItem = Nothing + BTLPart_DataGrid.SelectedItem = Row.DataContext + ' metto focus su cella selezionata per evitare errori di focus del sistema normale + Dim dep As DependencyObject = CType(e.OriginalSource, DependencyObject) + While (dep IsNot Nothing) AndAlso Not (TypeOf dep Is DataGridCell) + dep = VisualTreeHelper.GetParent(dep) + End While + If dep Is Nothing Then Return + If TypeOf dep Is DataGridCell Then + Dim cell As DataGridCell = TryCast(dep, DataGridCell) + cell.Focus() + End If + End If + End Select + End If + + End Sub + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml new file mode 100644 index 00000000..39d4d7ee --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml.vb new file mode 100644 index 00000000..9558fa95 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdBTLPartManagerV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/OnlyProdCalcPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/OnlyProdCalcPanelV.xaml new file mode 100644 index 00000000..0568d371 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/OnlyProdCalcPanelV.xaml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb new file mode 100644 index 00000000..888405bb --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdConfigurationPageV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index a1763412..98d8ae96 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -183,14 +183,26 @@ NewAddFeatureWndV.xaml + + OnlyProdBTLPartListV.xaml + BTLPartManagerV.xaml + + OnlyProdBTLPartManagerV.xaml + + + OnlyProdCalcPanelV.xaml + ChangeMaterialWndV.xaml + + OnlyProdConfigurationPageV.xaml + @@ -198,20 +210,62 @@ FeatureListManagerV.xaml + + OnlyProdFeatureListManagerV.xaml + + + OnlyProdFeatureManagerV.xaml + + + OnlyProdFreeContourInputV.xaml + + + OnlyProdFreeContourManagerV.xaml + + + OnlyProdInstrumentPanelV.xaml + OnlyProdFeatureInPartInRawPartListV.xaml + + OnlyProdPartInRawPartListV.xaml + + + OnlyProdRawPartListV.xaml + NewMacroFeatureWnd.xaml + + OnlyProdPartInRawPartManagerV.xaml + PartInRawPartManagerWndV.xaml + + OnlyProdPartManagerV.xaml + + + OnlyProdRawPartManagerV.xaml + RawPartManagerWndV.xaml + + OnlyProdShowBeamPanelV.xaml + + + OnlyProdShowPanelV.xaml + + + OnlyProdSpecialPanelV.xaml + + + OnlyProdStatisticsTimePanelV.xaml + ProdWndV.xaml @@ -380,6 +434,9 @@ + + OnlyProdViewPanelV.xaml + WarehouseWndV.xaml @@ -478,22 +535,66 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -502,6 +603,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -514,6 +619,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -526,10 +635,30 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -666,6 +795,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml new file mode 100644 index 00000000..910859b8 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml @@ -0,0 +1,37 @@ + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml.vb new file mode 100644 index 00000000..ecb4d0f4 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdFeatureListManagerV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/FeatureManager/OnlyProdFeatureManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/FeatureManager/OnlyProdFeatureManagerV.xaml new file mode 100644 index 00000000..955de3e5 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/FeatureManager/OnlyProdFeatureManagerV.xaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/FreeContourManager/OnlyProdFreeContourManagerV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/FreeContourManager/OnlyProdFreeContourManagerV.xaml.vb new file mode 100644 index 00000000..d709879c --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/FreeContourManager/OnlyProdFreeContourManagerV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdFreeContourManagerV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml index a82b4751..fb8a1a00 100644 --- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml @@ -45,7 +45,7 @@ - + --> diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml new file mode 100644 index 00000000..41672c92 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml.vb new file mode 100644 index 00000000..222eb955 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdInstrumentPanelV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml index 75672dfe..34d3aa92 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml @@ -23,14 +23,6 @@ RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureInPartInRawPartListV}}}"/> - - @@ -96,6 +88,11 @@ + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb index 0b0c2373..7ffe09bc 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb @@ -13,4 +13,13 @@ Public Class OnlyProdFeatureInPartInRawPartListV End If End Sub + Private Sub FeatureList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + If TypeOf sender Is DataGridRow Then + Dim Row As DataGridRow = DirectCast(sender, DataGridRow) + If Not IsNothing(Row) AndAlso Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart) Then + Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM + End If + End If + End Sub + End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml new file mode 100644 index 00000000..b5903a48 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml.vb new file mode 100644 index 00000000..85174012 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml.vb @@ -0,0 +1,29 @@ +Imports EgtBEAMWALL.Core +Imports EgtUILib.EgtInterface + +Public Class OnlyProdPartInRawPartListV + + ' funzione che permette di selezionare un pezzo anche quando gia' selezionato + Private Sub PartInRawPartRow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + If TypeOf sender Is DataGridRow Then + Dim Row As DataGridRow = DirectCast(sender, DataGridRow) + If Not IsNothing(Row) Then + Dim MyMachGroup As Core.MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup + If EgtGetCurrMachGroup() = GDB_ID.NULL Then Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = MyMachGroup + MyMachGroup.SelPart = MyMachGroup.SelPart + End If + End If + End Sub + + ' funzione che impedisce di editare le righe che sono gia' in produzione + Private Sub PartInRawPartList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs) + If IsNothing(e.Row) Then Return + Dim RowVM As PartVM = DirectCast(e.Row.DataContext, PartVM) + ' se in produzione impedisco modifica dei parametri + If RowVM.nProduction_State > ItemState.ND Then + 'For Each cell In Row.Item + e.Cancel = True + End If + End Sub + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml new file mode 100644 index 00000000..d3eaa82c --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml.vb new file mode 100644 index 00000000..846ac030 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml.vb @@ -0,0 +1,28 @@ +Imports EgtBEAMWALL.Core + +Public Class OnlyProdRawPartListV + + ' funzione che permette di selezionare un RawPart anche quando gia' selezionato + Private Sub RawPartRow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + If TypeOf sender Is DataGridRow Then + Dim Row As DataGridRow = DirectCast(sender, DataGridRow) + Dim RowVM As MyMachGroupVM = DirectCast(Row.DataContext, MyMachGroupVM) + ' se gia' selezionato rifaccio selezione perche' potrbbe essere selezionato un BTLPart + If Not IsNothing(Row) AndAlso Row.IsSelected Then + Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup + End If + End If + End Sub + + ' funzione che impedisce di editare le righe che sono gia' in produzione + Private Sub RawPartList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs) + If IsNothing(e.Row) Then Return + Dim RowVM As MyMachGroupVM = DirectCast(e.Row.DataContext, MyMachGroupVM) + ' se in produzione impedisco modifica dei parametri + If RowVM.nProduction_State > ItemState.ND Then + 'For Each cell In Row.Item + e.Cancel = True + End If + End Sub + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml index db17f7e0..100131de 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml @@ -95,10 +95,10 @@ - + - + diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml index 9ff46053..9536e712 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml @@ -10,8 +10,8 @@ Visibility="{Binding DataContext.OnlyProdManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/> - + @@ -40,16 +40,16 @@ - - - - - - - + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml new file mode 100644 index 00000000..7b8442eb --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml @@ -0,0 +1,35 @@ + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml.vb new file mode 100644 index 00000000..65bbae45 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdPartInRawPartManagerV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/PartInRawPartManagerWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/PartInRawPartManagerWndV.xaml index dfb4b5ad..84b9d231 100644 --- a/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/PartInRawPartManagerWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/PartInRawPartManagerWndV.xaml @@ -8,10 +8,10 @@ - + - + diff --git a/EgtBEAMWALL.ViewerOptimizer/PartManager/OnlyProdPartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/PartManager/OnlyProdPartManagerV.xaml new file mode 100644 index 00000000..00218674 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/PartManager/OnlyProdPartManagerV.xaml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/PartManager/OnlyProdPartManagerV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/PartManager/OnlyProdPartManagerV.xaml.vb new file mode 100644 index 00000000..9daecf28 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/PartManager/OnlyProdPartManagerV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdPartManagerV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml new file mode 100644 index 00000000..a7621ef9 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml.vb new file mode 100644 index 00000000..2c280369 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdRawPartManagerV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/RawPartManager/RawPartManagerWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/RawPartManagerWndV.xaml index 1d0e9418..a45f2144 100644 --- a/EgtBEAMWALL.ViewerOptimizer/RawPartManager/RawPartManagerWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/RawPartManagerWndV.xaml @@ -8,10 +8,10 @@ - + - + diff --git a/EgtBEAMWALL.ViewerOptimizer/SceneHost/SceneHostV.xaml b/EgtBEAMWALL.ViewerOptimizer/SceneHost/SceneHostV.xaml index 7210e7b9..22e55479 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SceneHost/SceneHostV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/SceneHost/SceneHostV.xaml @@ -1,7 +1,7 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:EgtUILib="clr-namespace:EgtUILib;assembly=EgtUILib"> diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml new file mode 100644 index 00000000..38175e02 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml.vb new file mode 100644 index 00000000..db179cf2 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdShowBeamPanelV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml new file mode 100644 index 00000000..6229e556 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml.vb new file mode 100644 index 00000000..5f380de9 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdShowPanelV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml new file mode 100644 index 00000000..5522ebf5 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml.vb new file mode 100644 index 00000000..10cd9476 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdSpecialPanelV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml new file mode 100644 index 00000000..6f376332 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml.vb new file mode 100644 index 00000000..e3f5b133 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdStatisticsTimePanelV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProjWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProjWndV.xaml index 1f451aa1..c4a849b2 100644 --- a/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProjWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProjWndV.xaml @@ -8,11 +8,11 @@ - - + + @@ -28,7 +28,7 @@ - + - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ViewPanel/OnlyProdViewPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/ViewPanel/OnlyProdViewPanelV.xaml new file mode 100644 index 00000000..4bcf0a29 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ViewPanel/OnlyProdViewPanelV.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ViewPanel/OnlyProdViewPanelV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ViewPanel/OnlyProdViewPanelV.xaml.vb new file mode 100644 index 00000000..366de359 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ViewPanel/OnlyProdViewPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdViewPanelV + +End Class From 5be9816bbdf6bedadbc402c9ad55b9413e3b6130 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Mon, 8 Apr 2024 17:29:49 +0200 Subject: [PATCH 086/126] -gestito configuration page per nuova pagina --- .../ConfigurationPage/ConfigurationPageV.xaml | 3 ++- .../ConfigurationPage/OnlyProdConfigurationPageV.xaml | 3 ++- .../ItemParamList/FeatureInPartInRawPartListVM.vb | 1 + EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml | 3 ++- EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb | 7 +++++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml index ac8c9187..66c27f57 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageV.xaml @@ -2,7 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" - xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"> + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" + DataContext="{StaticResource ConfigurationPageVM}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml index 36995033..74723ed3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml @@ -2,7 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" - xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"> + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" + DataContext="{StaticResource ConfigurationPageVM}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListVM.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListVM.vb index ad3ef5f4..feacbf92 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListVM.vb @@ -54,6 +54,7 @@ Public Class FeatureInPartInRawPartListVM End If Dim Feature As BTLFeatureVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList(FeatureIndex) Feature.bDO = value + Feature.NotifyPropertyChanged(NameOf(Feature.bDO)) Next End Set End Property diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml index bbe879e9..500d3503 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml @@ -35,7 +35,8 @@ - + + diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb index fe77f736..544f4800 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb @@ -61,6 +61,13 @@ Public Class MainWindowVM End Get End Property + Private m_ConfigrationContent As Object + Public ReadOnly Property ConfigrationContent As Object + Get + Return If(Map.refMainWindowVM.MainWindowM.bOnlyProd, New OnlyProdConfigurationPageV(), New ConfigurationPageV()) + End Get + End Property + 'Friend m_SupervisorStop As Boolean = False Private BlockedWnd As BlockedWndV From 957ad00657ecc0ca00df87b3125b93c887b40ee9 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 10 Apr 2024 10:05:02 +0200 Subject: [PATCH 087/126] -aggiunte pagine per nuova grafica interfaccia --- .../AddPartWnd/OnlyProdAddPartWndV.xaml | 104 +++++ .../AddPartWnd/OnlyProdAddPartWndV.xaml.vb | 18 + .../AddRawPartWnd/OnlyProdAddRawPartWndV.xaml | 65 +++ .../OnlyProdAddRawPartWndV.xaml.vb | 18 + .../BTLPartManager/BTLPartManagerVM.vb | 21 +- .../BTLViewModel/BTLStructureVM.vb | 4 +- .../ConfigurationPage/ConfigurationPageVM.vb | 7 +- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 56 +++ .../InputPwdWnd/OnlyProdInputPwdWndV.xaml | 50 +++ .../InputPwdWnd/OnlyProdInputPwdWndV.xaml.vb | 25 ++ .../FeatureInPartInRawPartListV.xaml | 22 +- .../FeatureInPartInRawPartListVM.vb | 31 -- .../ItemParamList/FeatureListV.xaml | 19 +- .../OnlyProdFeatureInPartInRawPartListV.xaml | 8 +- .../ItemParamList/OnlyProdFeatureListV.xaml | 4 - .../MachGroupPanel/PartVM.vb | 31 ++ .../MainMenu/MainMenuV.xaml | 3 +- .../MainMenu/OnlyProdMainMenuV.xaml | 31 ++ .../MainMenu/OnlyProdMainMenuV.xaml.vb | 3 + .../MainWindow/MainWindowV.xaml | 2 +- .../MainWindow/MainWindowVM.vb | 10 +- .../OnlyProdNestingRunningWndV.xaml | 54 +++ .../OnlyProdNestingRunningWndV.xaml.vb | 22 + .../OptimizePanel/OptimizePanelVM.vb | 14 +- .../OnlyProdOptimizerStatisticsV.xaml | 248 +++++++++++ .../OnlyProdOptimizerStatisticsV.xaml.vb | 3 + .../Statistics/OnlyProdStatisticsV.xaml | 184 ++++++++ .../Statistics/OnlyProdStatisticsV.xaml.vb | 10 + .../OptimizerStatisticsWndV.xaml | 2 +- .../StatisticsWnd/StatisticsWndV.xaml | 2 +- .../WarehouseWnd/OnlyProdWarehouseWndV.xaml | 415 ++++++++++++++++++ .../OnlyProdWarehouseWndV.xaml.vb | 19 + 32 files changed, 1443 insertions(+), 62 deletions(-) create mode 100644 EgtBEAMWALL.ViewerOptimizer/AddPartWnd/OnlyProdAddPartWndV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/AddPartWnd/OnlyProdAddPartWndV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/AddRawPartWnd/OnlyProdAddRawPartWndV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/AddRawPartWnd/OnlyProdAddRawPartWndV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/NestingRunningWnd/OnlyProdNestingRunningWndV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/NestingRunningWnd/OnlyProdNestingRunningWndV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdOptimizerStatisticsV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdOptimizerStatisticsV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml.vb diff --git a/EgtBEAMWALL.ViewerOptimizer/AddPartWnd/OnlyProdAddPartWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/AddPartWnd/OnlyProdAddPartWndV.xaml new file mode 100644 index 00000000..3a081935 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/AddPartWnd/OnlyProdAddPartWndV.xaml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml.vb new file mode 100644 index 00000000..61ae84b7 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdMainMenuV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml index 500d3503..1b1ea52a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml @@ -36,7 +36,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb index 544f4800..97ef66f4 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb @@ -54,20 +54,24 @@ Public Class MainWindowVM End Get End Property - Private m_ProjectContent As Object Public ReadOnly Property ProjectContent As Object Get Return If(Map.refMainWindowVM.MainWindowM.bOnlyProd, New OnlyProdProjectV(), New ProjectV()) End Get End Property - Private m_ConfigrationContent As Object - Public ReadOnly Property ConfigrationContent As Object + Public ReadOnly Property ConfigurationPageContent As Object Get Return If(Map.refMainWindowVM.MainWindowM.bOnlyProd, New OnlyProdConfigurationPageV(), New ConfigurationPageV()) End Get End Property + Public ReadOnly Property MainMenuContent As Object + Get + Return If(Map.refMainWindowVM.MainWindowM.bOnlyProd, New OnlyProdMainMenuV(), New MainMenuV()) + End Get + End Property + 'Friend m_SupervisorStop As Boolean = False Private BlockedWnd As BlockedWndV diff --git a/EgtBEAMWALL.ViewerOptimizer/NestingRunningWnd/OnlyProdNestingRunningWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/NestingRunningWnd/OnlyProdNestingRunningWndV.xaml new file mode 100644 index 00000000..b95aafc6 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/NestingRunningWnd/OnlyProdNestingRunningWndV.xaml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdOptimizerStatisticsV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdOptimizerStatisticsV.xaml.vb new file mode 100644 index 00000000..64883fe6 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdOptimizerStatisticsV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdOptimizerStatisticsV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml new file mode 100644 index 00000000..81bd4e8c --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml.vb new file mode 100644 index 00000000..0448cdcd --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml.vb @@ -0,0 +1,10 @@ +Public Class OnlyProdStatisticsV + + Private m_StatisticsVM As StatisticsVM + + Private Sub PrintBtn_Click(sender As Object, e As RoutedEventArgs) Handles CopyToClipboardBtn.Click + m_StatisticsVM = Me.DataContext() + ExportToExcelAndCsv(dgStatistics, m_StatisticsVM) + End Sub + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml index 1375f60a..dc6a6d6b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml @@ -15,6 +15,6 @@ Name="OptimizerStatisticsWndV" Width="1000"> - + diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml index 51041c82..1f07a1aa 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml @@ -16,7 +16,7 @@ MaxHeight="600" Width="1300"> - + diff --git a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml new file mode 100644 index 00000000..8bb0da84 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml.vb new file mode 100644 index 00000000..a80de7fb --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml.vb @@ -0,0 +1,19 @@ +Public Class OnlyProdWarehouseWndV + + Private WithEvents m_WarehouseWndVM As WarehouseWndVM + + Sub New(Owner As Window, WarehouseWndVM As WarehouseWndVM) + MyBase.New(Owner) + ' This call is required by the designer. + InitializeComponent() + Me.DataContext = WarehouseWndVM + Me.Tag = Map.refProjectVM.BTLStructureVM + ' Assegno al riferimento locale al VM il VM preso dal DataContext + m_WarehouseWndVM = WarehouseWndVM + End Sub + + Private Sub CloseWindow(bDialogResult As Boolean) Handles m_WarehouseWndVM.m_CloseWindow + Me.DialogResult = bDialogResult + End Sub + +End Class From 05bf06d1e2562d259aa3bf0580d5a021a4f053f9 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 10 Apr 2024 16:30:26 +0200 Subject: [PATCH 088/126] - aggiunta immagine non presente --- EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb | 4 ++-- EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb index 38d4b4aa..11b0ca22 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb @@ -566,8 +566,8 @@ Public Class MainMenuVM Map.refProjectVM.SetOnlyProdOptimizePanel_Visibility(True) Map.refProjectVM.SetOptimizePanel_Visibility(True) Map.refProjectVM.NotifyAllPanelVisibility() - 'Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(Map.refMainMenuVM.SelPage = Pages.NEWPAGE AndAlso Map.refMachinePanelVM.MachineList.Count > 1 AndAlso GetMainPrivateProfileInt(S_MACH, K_CHANGEMACH, 0) = 1) - Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(True) + Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refMachinePanelVM.MachineList.Count > 1 AndAlso GetMainPrivateProfileInt(S_MACH, K_CHANGEMACH, 0) = 1) + 'Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(True) Map.refStatisticsTimePanelVM.SetStatisticsTimePanel_Visibility() If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb index 221a1cae..9592189b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb @@ -8,6 +8,7 @@ Imports System.Collections.ObjectModel Imports PdfSharp.Drawing Imports MigraDoc.DocumentObjectModel.Shapes Imports System.Windows.Forms.VisualStyles.VisualStyleElement.Header +Imports System.IO Module PDFHelper @@ -811,7 +812,13 @@ Module PDFHelper Private Sub CreateRawPartImage(section As Section, sMachGroupList As ExpanderTable, RawPartId As Integer, RawPartName As String, bPreview As Boolean) ' creo immagine - Dim sImagePath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Image" & RawPartId & ".png" + 'Dim sImagePath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Image" & RawPartId & ".png" + Dim sImagePath As String = String.Empty + If File.Exists(Map.refMainWindowVM.MainWindowM.sTempDir & "\Image" & RawPartId & ".png") Then + sImagePath = Map.refMainWindowVM.MainWindowM.sTempDir & "\Image" & RawPartId & ".png" + Else + sImagePath = Map.refMainWindowVM.MainWindowM.sTempDir & "\ImageNotFound.png" + End If If bPreview Then EgtSetCurrMachGroup(RawPartId) Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.FRONT, VT.TOP), False) From 19f0ed75a42e1a9f5229d73bb570d5cc8e162de7 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 12 Apr 2024 17:28:26 +0200 Subject: [PATCH 089/126] -modifiche su proj nuova pagina --- .../BTLPartManager/BTLPartManagerVM.vb | 3 +- .../BTLViewModel/BTLPartVM.vb | 2 +- .../CALCPanel/CALCPanelVM.vb | 12 ++++---- .../OnlyProdManager/OnlyProdManagerVM.vb | 18 +++++------ .../ProdManager/ProdManagerVM.vb | 3 +- .../ProjManager/ProjManagerVM.vb | 30 ++++++++++--------- .../ProjectManager/ProjectManagerVM.vb | 11 +++++++ .../SceneHost/MySceneHostVM.vb | 24 ++++++++++----- 8 files changed, 62 insertions(+), 41 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb index 1798a601..990234ce 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb @@ -952,7 +952,7 @@ Public Class BTLPartManagerVM ''' Public Sub AddPart(ByVal param As Object) If IsNothing(ProjectManagerVM.CurrProj) Then Return - If IsNothing(ProjectManagerVM.CurrProj) Then Return + If IsNothing(ProjectManagerVM.CurrProd) Then Return ' apro finestra di definizione nuovo part Dim AddPartWndVM As New AddPartWndVM() Dim AddPartWnd As Object = Nothing @@ -966,7 +966,6 @@ Public Class BTLPartManagerVM Dim nNewPartId As Integer = EgtBeamCreatePart() ' scrivo info proj EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProj.nProjId) - EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProj.nProjId) EgtBeamSetPartProdNbr(AddPartWndVM.nPDN) If Not IsNothing(AddPartWndVM.sNAM) Then EgtBeamSetPartName(AddPartWndVM.sNAM) EgtBeamSetPartCount(AddPartWndVM.nCNT) diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb index 2e4c4cf0..3371dbb1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb @@ -1835,7 +1835,7 @@ Public Class BTLPartVM If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjManagerVM) Then EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProj.nProjId) ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then - EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.CurrProd.nProdId) + EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.CurrProd.nProjIdList(0)) End If EgtBeamSetPartProdNbr(m_BTLStructureM.NewPDN()) EgtBeamSetPartName(m_BTLPartM.sNAM) diff --git a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb index df776a4b..47cc04e2 100644 --- a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb @@ -1169,7 +1169,11 @@ Public Class CALCPanelVM Dim nPartProjId As Integer 'Dim TempList As New List(Of BTLPartM) Dim nPartId As Integer = EgtGetFirstPart() - ProjId = ProjectManagerVM.CurrProj.nProjId + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + ProjId = ProjectManagerVM.CurrProd.nProjIdList(0) + Else + ProjId = ProjectManagerVM.CurrProj.nProjId + End If EgtGetInfo(nPartId, BTL_PRT_PROJ, nPartProjId) While nPartId <> GDB_ID.NULL ' se devo filtrare un progetto @@ -1222,11 +1226,7 @@ Public Class CALCPanelVM End If End If ' rigenero struttura BTL - If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then - Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(nPartProjId)) - Else - Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjId)) - End If + Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjId)) End Sub #End Region ' Ok diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb index bfa454b3..07680513 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb @@ -58,12 +58,12 @@ Public Class OnlyProdManagerVM End Property ' indice progetto in caricamento - Private m_nLoadingProjId As Integer = 0 - Public ReadOnly Property nLoadingProjId As Integer - Get - Return m_nLoadingProjId - End Get - End Property + 'Private m_nLoadingProjId As Integer = 0 + 'Public ReadOnly Property nLoadingProjId As Integer + ' Get + ' Return m_nLoadingProjId + ' End Get + 'End Property Friend m_MruFiles As New MruList Public ReadOnly Property MruFileNames As ObservableCollection(Of String) @@ -483,7 +483,7 @@ Public Class OnlyProdManagerVM Map.refCALCPanelVM.LoadMachineList() Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge" ' imposto ProjId di caricamento - m_nLoadingProjId = nProjId + ProjectManagerVM.nLoadingProjId = nProjId ' creo gruppo BTLinfo Dim nBTLInfoLayer As Integer = EgtCreateGroup(GDB_ID.ROOT) EgtSetName(nBTLInfoLayer, BTLINFO) @@ -795,7 +795,7 @@ Public Class OnlyProdManagerVM ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel Map.refCALCPanelVM.LoadMachineList() ' imposto ProjId di caricamento - m_nLoadingProjId = nProjId + ProjectManagerVM.nLoadingProjId = nProjId ' copio file BTL Dim sBtlCopyPath As String = sProjDir & "\" & Path.GetFileName(sFile) Dim bOk = False @@ -1613,7 +1613,7 @@ Public Class OnlyProdManagerVM InitNewProj(nNewProjId, sNewProjDir, nType, Machine) NewProjIdList.Add(nNewProjId) ' imposto ProjId di caricamento - m_nLoadingProjId = nImportProjId + ProjectManagerVM.nLoadingProjId = nImportProjId ' costruisco BTLStructure del proj Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(nImportProjId)) ' scrivo info proj su tutti i pezzi di questo progetto diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb index 07c2dc45..9a058c4f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb @@ -587,7 +587,8 @@ Public Class ProdManagerVM ' apro progetto proj Map.refProjManagerVM.SetCurrProj(nProjId) ' ricarico progetto se il prod e' nullo (quindi e' stato cancellato) - ProjectManagerVM.CurrProj.SetReloadProject(IsNothing(CurrProd) OrElse VerifyResult = MessageBoxResult.No) + 'ProjectManagerVM.CurrProj.SetReloadProject(IsNothing(CurrProd) OrElse VerifyResult = MessageBoxResult.No) + ProjectManagerVM.CurrProj.SetReloadProject(IsNothing(CurrProd) OrElse VerifyResult = MessageBoxResult.No OrElse VerifyResult = MessageBoxResult.None) ' vado in pagina proj Map.refMainMenuVM.SetSelPage(Pages.VIEW, False) LoadingWndHelper.CloseLoadingWnd(ActiveIds.GOTOPROJ) diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb index 61815d3a..8896ac8f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb @@ -67,12 +67,12 @@ Public Class ProjManagerVM End Property ' indice progetto in caricamento - Private m_nLoadingProjId As Integer = 0 - Public ReadOnly Property nLoadingProjId As Integer - Get - Return m_nLoadingProjId - End Get - End Property + 'Private m_nLoadingProjId As Integer = 0 + 'Public ReadOnly Property nLoadingProjId As Integer + ' Get + ' Return m_nLoadingProjId + ' End Get + 'End Property Friend m_MruFiles As New MruList Public ReadOnly Property MruFileNames As ObservableCollection(Of String) @@ -374,7 +374,7 @@ Public Class ProjManagerVM Map.refCALCPanelVM.LoadMachineList() Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge" ' imposto ProjId di caricamento - m_nLoadingProjId = nProjId + ProjectManagerVM.nLoadingProjId = nProjId ' creo gruppo BTLinfo Dim nBTLInfoLayer As Integer = EgtCreateGroup(GDB_ID.ROOT) EgtSetName(nBTLInfoLayer, BTLINFO) @@ -465,7 +465,8 @@ Public Class ProjManagerVM End If LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROJ, 3, EgtMsg(63000), EgtMsg(63001), 50) ' Project opening ' Loading project geometries ' imposto ProjId di caricamento - m_nLoadingProjId = TempCurrProj.nProjId + 'm_nLoadingProjId = TempCurrProj.nProjId + ProjectManagerVM.nLoadingProjId = TempCurrProj.nProjId ' se esiste prod prendo quello, altrimenti proj Dim sFilePath As String = "" If Not IsNothing(TempCurrProj.nProdId) AndAlso TempCurrProj.nProdId > 0 Then @@ -482,7 +483,7 @@ Public Class ProjManagerVM ' se la macchina del progetto in apertura non è tra le macchine disponibili lo segnalo e apro un progetto vuoto If IsNothing(Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.TempCurrProj.sMachine)) Then ' rimuovo il file in apertura dalla lista degli MRU - Dim ProjId As Integer = Map.refProjManagerVM.nLoadingProjId + Dim ProjId As Integer = ProjectManagerVM.nLoadingProjId Dim PjFileVM As ProjFileVM If Not IsNothing(ProjId) AndAlso ProjId <> 0 Then PjFileVM = New ProjFileVM(DbControllers.m_ProjController.FindByProjIdConv(ProjId)) @@ -564,7 +565,7 @@ Public Class ProjManagerVM ' se vista tutti i pezzi Configuration.ShowAllPieces(bShowBuilding, bShowSolid, True, False) ' imposto ProjId di caricamento - m_nLoadingProjId = CurrProj.nProjId + ProjectManagerVM.nLoadingProjId = CurrProj.nProjId Map.refSceneHostVM.SaveProject() Map.refMainWindowVM.SetTitle(CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - EgtBEAMWALL") ' aggiorno BTLParts su DB @@ -690,7 +691,7 @@ Public Class ProjManagerVM ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel Map.refCALCPanelVM.LoadMachineList() ' imposto ProjId di caricamento - m_nLoadingProjId = nProjId + ProjectManagerVM.nLoadingProjId = nProjId ' copio file BTL Dim sBtlCopyPath As String = sProjDir & "\" & Path.GetFileName(sFile) Dim bOk = False @@ -1519,7 +1520,7 @@ Public Class ProjManagerVM InitNewProject(nNewProjId, sNewProjDir, nType, Machine) NewProjIdList.Add(nNewProjId) ' imposto ProjId di caricamento - m_nLoadingProjId = nImportProjId + ProjectManagerVM.nLoadingProjId = nImportProjId ' costruisco BTLStructure del proj Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(nImportProjId)) ' scrivo info proj su tutti i pezzi di questo progetto @@ -1756,8 +1757,9 @@ Public Class ProjManagerVM Dim nProdId As Integer = ProjectManagerVM.CurrProj.nProdId If nProdId > 0 Then - Map.refProdManagerVM.SetCurrProd(nProdId) - ProjectManagerVM.CurrProd.SetReloadProject(Not bSaved) + ProjectManagerVM.SetCurrProd(nProdId) + 'ProjectManagerVM.CurrProd.SetReloadProject(Not bSaved) + ProjectManagerVM.CurrProd.SetReloadProject(bSaved) Else 'creo nuova ottimizzazione da progetto corrente NewProdFromProj() diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjectManager/ProjectManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjectManager/ProjectManagerVM.vb index 7cb36366..79add1f0 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjectManager/ProjectManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjectManager/ProjectManagerVM.vb @@ -23,6 +23,17 @@ Module ProjectManagerVM End Set End Property + ' indice progetto in caricamento + Private m_nLoadingProjId As Integer = 0 + Friend Property nLoadingProjId As Integer + Get + Return m_nLoadingProjId + End Get + Set(value As Integer) + m_nLoadingProjId = value + End Set + End Property + Public Function SetCurrProj(nProjId As Integer) As Boolean Dim CurrProjM As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(nProjId) If IsNothing(CurrProjM) Then Return False diff --git a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb index f5348545..21e909a4 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb @@ -519,7 +519,15 @@ Public Class MySceneHostVM Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean) Dim ProjectType As ProjectType = If(Map.refMainMenuVM.SelPage = Pages.VIEW, ProjectType.PROJ, ProjectType.PROD) - Dim ProjId As Integer = If(ProjectType = ProjectType.PROJ, Map.refProjManagerVM.nLoadingProjId, 0) + Dim ProjId As Integer = If(ProjectType = ProjectType.PROJ, ProjectManagerVM.nLoadingProjId, 0) + 'Dim ProjId As Integer = 0 + 'If ProjectType = ProjectType.PROJ Then + ' ProjId = ProjectManagerVM.nLoadingProjId + 'ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + ' ProjId = ProjectManagerVM.CurrProd.nProjIdList(0) + 'Else + ' ProjId = 0 + 'End If Dim CurrProd As ProdFileVM = Nothing ' Procedo a seconda del risultato If bOk Then @@ -667,7 +675,7 @@ Public Class MySceneHostVM Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean) Dim ProjectType As ProjectType = If(Map.refMainMenuVM.SelPage = Pages.VIEW, ProjectType.PROJ, ProjectType.PROD) - Dim ProjId As Integer = If(ProjectType = ProjectType.PROJ, Map.refProjManagerVM.nLoadingProjId, 0) + Dim ProjId As Integer = If(ProjectType = ProjectType.PROJ, ProjectManagerVM.nLoadingProjId, 0) ' Se salvataggio non riuscito, esco subito If Not bOk Then ' in base al tipo progetto rimuovo il file in salvataggio dalla lista degli MRU @@ -728,9 +736,9 @@ Public Class MySceneHostVM While nPartId <> GDB_ID.NULL ' scrivo in ogni pezzo ProjId If Not IsNothing(Map.refProjManagerVM) Then - EgtSetInfo(nPartId, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) + EgtSetInfo(nPartId, BTL_PRT_PROJ, ProjectManagerVM.nLoadingProjId) ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then - EgtSetInfo(nPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.nLoadingProjId) + EgtSetInfo(nPartId, BTL_PRT_PROJ, ProjectManagerVM.nLoadingProjId) End If nPartId = EgtGetNextPart(nPartId) ' scrivo Id negli outline @@ -751,18 +759,18 @@ Public Class MySceneHostVM ' scrivo info proj e type su layer BtlInfo Dim nBTLInfoLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) If Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj) Then - EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) + EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, ProjectManagerVM.nLoadingProjId) EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, ProjectManagerVM.CurrProj.nType) ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) Then - EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.nLoadingProjId) + EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, ProjectManagerVM.nLoadingProjId) EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refOnlyProdManagerVM.CurrProd.nType) End If ' scrivo info proj su layer AsseBase Dim nAsseBaseLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) If Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj) Then - EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId) + EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, ProjectManagerVM.nLoadingProjId) ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) Then - EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.nLoadingProjId) + EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, ProjectManagerVM.nLoadingProjId) End If Else Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file From 021aca88477a916195acc6496522cd4042853d7f Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 16 Apr 2024 16:58:37 +0200 Subject: [PATCH 090/126] -aggiornato codice - aggiunto pagina OnlyProdProjectType --- .../BTLPartManager/BTLPartManagerVM.vb | 12 +- .../BTLViewModel/BTLPartVM.vb | 4 +- .../CALCPanel/CALCPanelVM.vb | 6 +- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 21 ++++ .../MachGroupPanel/MyMachGroupVM.vb | 2 +- .../MachGroupPanel/PartVM.vb | 2 +- .../MainWindow/MainWindowVM.vb | 18 +-- .../OnlyProdManager/OnlyProdManagerVM.vb | 45 +------- .../ProjectFileVM/ProdFileVM.vb | 2 +- .../ProjectFileVM/ProjFileVM.vb | 2 +- .../OnlyProdProjectTypeWndV.xaml | 94 ++++++++++++++++ .../OnlyProdProjectTypeWndV.xaml.vb | 18 +++ .../ProjectTypeWnd/ProjectTypeWndVM.vb | 2 +- .../SceneHost/MySceneHostVM.vb | 22 +--- .../UpdateBTLWnd/OnlyProdUpdateBTLWndV.xaml | 103 ++++++++++++++++++ .../OnlyProdUpdateBTLWndV.xaml.vb | 18 +++ .../OnlyProdUpdateOrAppendWndV.xaml | 66 +++++++++++ .../OnlyProdUpdateOrAppendWndV.xaml.vb | 18 +++ .../Utility/LuaExec.vb | 2 +- 19 files changed, 366 insertions(+), 91 deletions(-) create mode 100644 EgtBEAMWALL.ViewerOptimizer/ProjectTypeWnd/OnlyProdProjectTypeWndV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/ProjectTypeWnd/OnlyProdProjectTypeWndV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/UpdateBTLWnd/OnlyProdUpdateBTLWndV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/UpdateBTLWnd/OnlyProdUpdateBTLWndV.xaml.vb create mode 100644 EgtBEAMWALL.ViewerOptimizer/UpdateBTLWnd/OnlyProdUpdateOrAppendWndV.xaml create mode 100644 EgtBEAMWALL.ViewerOptimizer/UpdateBTLWnd/OnlyProdUpdateOrAppendWndV.xaml.vb diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb index 990234ce..e5178347 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb @@ -189,7 +189,6 @@ Public Class BTLPartManagerVM End Sub Public Sub NewRawPart(bLast As Boolean) - If IsNothing(ProjectManagerVM.CurrProd) Then Return If IsNothing(ProjectManagerVM.CurrProd) Then Return 'Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() @@ -335,11 +334,7 @@ Public Class BTLPartManagerVM EgtGetMachGroupName(nCurrMachGroup, sCurrMachGroupName) Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt" ' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione - If Map.refMainMenuVM.SelPage = Pages.MACHINING Then - EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, ProjectManagerVM.CurrProd.nProdId) - ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then - EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refOnlyProdManagerVM.CurrProd.nProdId) - End If + EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, ProjectManagerVM.CurrProd.nProdId) EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup) If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then ' ordino i pezzi per lunghezza @@ -622,7 +617,6 @@ Public Class BTLPartManagerVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub AddToRawPart() - If IsNothing(ProjectManagerVM.CurrProd) Then Return If IsNothing(ProjectManagerVM.CurrProd) Then Return Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0) Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() @@ -919,7 +913,6 @@ Public Class BTLPartManagerVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub CopyPart() - If IsNothing(ProjectManagerVM.CurrProj) Then Return If IsNothing(ProjectManagerVM.CurrProj) Then Return Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart If IsNothing(SelPart) Then Return @@ -952,7 +945,6 @@ Public Class BTLPartManagerVM ''' Public Sub AddPart(ByVal param As Object) If IsNothing(ProjectManagerVM.CurrProj) Then Return - If IsNothing(ProjectManagerVM.CurrProd) Then Return ' apro finestra di definizione nuovo part Dim AddPartWndVM As New AddPartWndVM() Dim AddPartWnd As Object = Nothing @@ -1129,7 +1121,6 @@ Public Class BTLPartManagerVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub BackRotation() - If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return ' salvo sezione impostata Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection @@ -1171,7 +1162,6 @@ Public Class BTLPartManagerVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub ForwardRotation() - If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return ' salvo sezione impostata Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb index 3371dbb1..c07fd43c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLPartVM.vb @@ -100,7 +100,7 @@ Public Class BTLPartVM If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjManagerVM) Then MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(ProjectManagerVM.CurrProj.nProdId, nMachgroupId) ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then - MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refOnlyProdManagerVM.CurrProj.nProdId, nMachgroupId) + MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(ProjectManagerVM.CurrProj.nProdId, nMachgroupId) End If If Not IsNothing(MachGroupModel) AndAlso MachGroupModel.State > ItemState.ND Then bDuploInProduction = True @@ -1835,7 +1835,7 @@ Public Class BTLPartVM If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjManagerVM) Then EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProj.nProjId) ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then - EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.CurrProd.nProjIdList(0)) + EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProd.nProjIdList(0)) End If EgtBeamSetPartProdNbr(m_BTLStructureM.NewPDN()) EgtBeamSetPartName(m_BTLPartM.sNAM) diff --git a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb index 47cc04e2..90c9bb2c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb @@ -605,7 +605,7 @@ Public Class CALCPanelVM If nMachType = nProjType OrElse (nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj)) OrElse (nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProd)) OrElse - (nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd)) Then + (nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProd)) Then MachineList.Add(Machine) ' Se il nome Macchina coincide setto la macchina selezionata con la macchina associata al progetto If Machine.Name = sMachineName Then @@ -671,7 +671,7 @@ Public Class CALCPanelVM Friend Sub Verify() If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse (Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse - (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(Map.refOnlyProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return + (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return Dim ProjType As BWType Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing If Map.refMainMenuVM.SelPage = Pages.VIEW Then @@ -685,7 +685,7 @@ Public Class CALCPanelVM ' lancio calcolo EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc) ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then - ProjType = Map.refOnlyProdManagerVM.CurrProd.nType + ProjType = ProjectManagerVM.CurrProd.nType If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return ' lancio calcolo diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index 8d28f7f3..b6b06930 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -263,6 +263,9 @@ OnlyProdPartManagerV.xaml + + OnlyProdProjectTypeWndV.xaml + OnlyProdRawPartManagerV.xaml @@ -438,6 +441,12 @@ + + OnlyProdUpdateBTLWndV.xaml + + + OnlyProdUpdateOrAppendWndV.xaml + UpdateBTLWndV.xaml @@ -679,6 +688,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -839,6 +852,14 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb index b210e59e..cfa24103 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb @@ -365,7 +365,7 @@ Public Class MyMachGroupVM If Not IsNothing(Map.refProdManagerVM) Then EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, ProjectManagerVM.CurrProd.nProdId) ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then - EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refOnlyProdManagerVM.CurrProd.nProdId) + EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, ProjectManagerVM.CurrProd.nProdId) End If EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, sMATERIAL) EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup) diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb index 12d42352..d989c0b1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb @@ -338,7 +338,7 @@ Public Class PartVM If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProdManagerVM) Then DbControllers.m_PartController.Delete(ProjectManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId) ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then - DbControllers.m_PartController.Delete(Map.refOnlyProdManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId) + DbControllers.m_PartController.Delete(ProjectManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId) End If If nType = MachineType.BEAM Then Dim BeamParentMachGroup As MyMachGroupVM = DirectCast(ParentMachGroupVM, MyMachGroupVM) diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb index 97ef66f4..6d7929ff 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb @@ -139,14 +139,14 @@ Public Class MainWindowVM m_Title = "Configuration Page" Case Pages.ONLYPRODPAGE If GetMainPrivateProfileInt(S_GENERAL, K_PROJECTMODE, 0) = 1 Then - If Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then - If Map.refOnlyProdManagerVM.CurrProd.bIsNew Then m_Title = "New - " - m_Title &= Map.refOnlyProdManagerVM.CurrProd.nProdId.ToString("0000") & " - " & Map.refOnlyProdManagerVM.CurrProd.sName + If Not IsNothing(ProjectManagerVM.CurrProd) Then + If ProjectManagerVM.CurrProd.bIsNew Then m_Title = "New - " + m_Title &= ProjectManagerVM.CurrProd.nProdId.ToString("0000") & " - " & ProjectManagerVM.CurrProd.sName End If Else - If Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then - If Map.refOnlyProdManagerVM.CurrProd.bIsNew Then m_Title = "New - " - m_Title &= Map.refOnlyProdManagerVM.CurrProd.nProdId.ToString("0000") & " - " & Map.refOnlyProdManagerVM.CurrProd.sBTLFileName + If Not IsNothing(ProjectManagerVM.CurrProd) Then + If ProjectManagerVM.CurrProd.bIsNew Then m_Title = "New - " + m_Title &= ProjectManagerVM.CurrProd.nProdId.ToString("0000") & " - " & ProjectManagerVM.CurrProd.sBTLFileName End If End If End Select @@ -408,7 +408,7 @@ Public Class MainWindowVM ' Verifica modifica parametri Macchina e chiedo il salvataggio Map.refConfigurationPageVM.VerifyConfigPageModification() Case Pages.ONLYPRODPAGE - bOk = ProdFileVM.VerifyProjectModification(Map.refOnlyProdManagerVM.CurrProd) <> MessageBoxResult.Cancel + bOk = ProdFileVM.VerifyProjectModification(ProjectManagerVM.CurrProd) <> MessageBoxResult.Cancel End Select ' se salvataggio annullato, rimango If Not bOk Then Return @@ -431,8 +431,8 @@ Public Class MainWindowVM DbControllers.m_ProjController.LockByProjId(ProjectManagerVM.CurrProj.nProjId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) Then DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) - ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then - DbControllers.m_ProdController.LockByProdId(Map.refOnlyProdManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) + ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) Then + DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) End If ' Termino il Model m_MainWindowM.Close() diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb index 07680513..27e41971 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb @@ -464,7 +464,7 @@ Public Class OnlyProdManagerVM Machine = ProjectTypeWndVM.SelMachine nType = DirectCast(Machine, MyMachine).nType Else - Dim ProjectTypeWnd As New ProjectTypeWndV(Application.Current.MainWindow, ProjectTypeWndVM) + Dim ProjectTypeWnd As New OnlyProdProjectTypeWndV(Application.Current.MainWindow, ProjectTypeWndVM) If ProjectTypeWnd.ShowDialog() Then Machine = ProjectTypeWndVM.SelMachine nType = ProjectTypeWndVM.nSelType @@ -778,7 +778,7 @@ Public Class OnlyProdManagerVM Machine = ProjectTypeWndVM.SelMachine nType = DirectCast(Machine, MyMachine).nType Else - Dim ProjectTypeWnd As New ProjectTypeWndV(Application.Current.MainWindow, ProjectTypeWndVM) + Dim ProjectTypeWnd As New OnlyProdProjectTypeWndV(Application.Current.MainWindow, ProjectTypeWndVM) If ProjectTypeWnd.ShowDialog() Then Machine = ProjectTypeWndVM.SelMachine nType = ProjectTypeWndVM.nSelType @@ -911,18 +911,6 @@ Public Class OnlyProdManagerVM Dim bShowSolid As Boolean = False Dim nSelPartId As Integer = GDB_ID.NULL Configuration.ShowAllPieces(bShowBuilding, bShowSolid, nSelPartId, True, True) - 'If Map.refShowBeamPanelVM.bShowAll Then - ' ' verifico se assemblato e lo annullo per salvataggio - ' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked - ' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - ' ' se vista singolo pezzo - 'Else - ' bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked - ' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False) - ' ' se pezzo selezionato lo segno e metto vista tutti - ' If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then nSelPartId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId - ' Map.refProjectVM.BTLStructureVM.ShowAll(False) - 'End If Dim sDir As String = String.Empty GetMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, "", sDir) @@ -1048,7 +1036,7 @@ Public Class OnlyProdManagerVM For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLStructureM.BTLPartMList If PartToUpdate.nPDN = BTLPart.nPDN Then Dim UpdateOrAppendWndVM As New UpdateOrAppendWndVM() - Dim UpdateOrAppendWnd As New UpdateOrAppendWndV(Application.Current.MainWindow, UpdateOrAppendWndVM) + Dim UpdateOrAppendWnd As New OnlyProdUpdateOrAppendWndV(Application.Current.MainWindow, UpdateOrAppendWndVM) If Not UpdateOrAppendWnd.ShowDialog() Then ' torno sul contesto corrente EgtSetCurrentContext(nCurrCtx) @@ -1163,7 +1151,7 @@ Public Class OnlyProdManagerVM ' altrimenti apro la finestra con l'elenco dei Part da checkare per l'inserimento nel progetto (unica strada se UserLevel <= 5), ' che prevederà la sovrascrittura di quelli già presenti e l'aggiunta di quelli nuovi Dim UpdateBTLWndVM As New UpdateBTLWndVM(PartToUpdateList) - Dim UpdateBTLWnd As New UpdateBTLWndV(Application.Current.MainWindow, UpdateBTLWndVM) + Dim UpdateBTLWnd As New OnlyProdUpdateBTLWndV(Application.Current.MainWindow, UpdateBTLWndVM) If Not UpdateBTLWnd.ShowDialog() Then ' torno sul contesto corrente EgtSetCurrentContext(nCurrCtx) @@ -1232,26 +1220,6 @@ Public Class OnlyProdManagerVM ' elimino i pezzi da sovrascrivere nel progetto corrente Configuration.DeletePieces(UpdateBTLWndVM.BTLPartList) - 'For Each BTLPartToOverwriteWith In UpdateBTLWndVM.BTLPartList - ' If BTLPartToOverwriteWith.bInsert Then - ' Dim BTLPartToUpdate As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPDN = BTLPartToOverwriteWith.nPDN) - ' ' se BTLPartToUpdate è Nothing significa che il pezzo è nuovo e quindi basta accodarlo senza eliminare nulla - ' If Not IsNothing(BTLPartToUpdate) Then - ' Dim nPartToDeleteId As Integer = BTLPartToUpdate.nPartId - ' Dim nCurrPartId = EgtGetCurrPart() - ' EgtErase(nPartToDeleteId) - ' nCurrPartId = EgtGetCurrPart() - ' ' verifico se rimuovere sezione dalla lista - ' If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToUpdate AndAlso x.Section = BTLPartToUpdate.Section) Then - ' Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToUpdate.Section) - ' End If - ' ' rimuovo dalla lista pezzi - ' Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToUpdate) - ' Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing) - ' Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index) - ' End If - ' End If - 'Next ' salvo gli id degli AsseBase presenti nel progetto corrente Dim AsseBaseIdList As New List(Of Integer) @@ -1439,11 +1407,6 @@ Public Class OnlyProdManagerVM Dim bShowBuilding As Boolean = False If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Configuration.ShowAllPieces(bShowBuilding) - 'If Map.refShowBeamPanelVM.bShowAll Then - ' ' verifico se assemblato e lo annullo per salvataggio - ' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked - ' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - 'End If End If ' per ogni BTLInfo nel progetto riporto il relativo nome del BTL diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb index 0f69ab3b..752ba574 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProdFileVM.vb @@ -170,7 +170,7 @@ Public Class ProdFileVM If Not IsNothing(Map.refProjManagerVM) AndAlso CurrProject.nProdId = ProjectManagerVM.CurrProj.nProdId Then ' reset prod in path proj Map.refProjManagerVM.UpdateCurrProj() - ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso CurrProject.nProdId = Map.refOnlyProdManagerVM.CurrProj.nProdId Then + ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso CurrProject.nProdId = ProjectManagerVM.CurrProj.nProdId Then ' reset prod in path proj Map.refOnlyProdManagerVM.UpdateCurrProj() End If diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProjFileVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProjFileVM.vb index 7bf08f13..017e976e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProjFileVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjectFileVM/ProjFileVM.vb @@ -158,7 +158,7 @@ Public Class ProjFileVM If Not IsNothing(Map.refProjManagerVM) Then ProjectManagerVM.CurrProj = Nothing ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then - Map.refOnlyProdManagerVM.CurrProj = Nothing + ProjectManagerVM.CurrProj = Nothing End If EgtResetModified() Return True diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjectTypeWnd/OnlyProdProjectTypeWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProjectTypeWnd/OnlyProdProjectTypeWndV.xaml new file mode 100644 index 00000000..7ffa1fcf --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/ProjectTypeWnd/OnlyProdProjectTypeWndV.xaml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -79,7 +79,7 @@ + Style="{StaticResource ListBox_PDF}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index 88ce35e6..f127d0dd 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -475,6 +475,36 @@ + + + + + + + @@ -520,21 +550,45 @@ - + - + + - - - - + + + + - - + + + + + + + + + + - + + + + @@ -882,7 +1134,74 @@ + + + + + + - - - @@ -1026,18 +1363,280 @@ - + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + From e75a9915aa08cf9751e6187ab79781cfc4b672d0 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 10 May 2024 16:50:35 +0200 Subject: [PATCH 097/126] -modificato grafica expander, combobox e button --- .../OnlyProdBTLPartManagerV.xaml | 1 + .../CALCPanel/OnlyProdCalcPanelV.xaml | 16 +- .../OnlyProdFeatureListManagerV.xaml | 2 + .../OnlyProdFeatureManagerV.xaml | 12 +- .../OnlyProdFreeContourManagerV.xaml | 22 +- .../OnlyProdInstrumentPanelV.xaml | 14 +- .../OnlyProdFeatureInPartInRawPartListV.xaml | 8 +- .../ItemParamList/OnlyProdFeatureListV.xaml | 4 +- .../OnlyProdPParameterListV.xaml | 2 +- .../OnlyProdPartInRawPartListV.xaml | 4 +- .../OnlyProdQParameterListProdV.xaml | 2 +- .../OnlyProdQParameterListV.xaml | 2 +- .../ItemParamList/OnlyProdRawPartListV.xaml | 2 +- .../LeftPanel/OnlyProdLeftPanelV.xaml | 15 +- .../OnlyProdManager/OnlyProdManagerV.xaml | 20 +- .../OnlyProdProject/OnlyProdProjectV.xaml | 35 +- .../OptimizePanel/OnlyProdOptimizePanelV.xaml | 35 +- .../OnlyProdPartInRawPartManagerV.xaml | 5 +- .../PartInRawPartManagerWndV.xaml | 14 +- .../PartManager/OnlyProdPartManagerV.xaml | 126 +++++--- .../OnlyProdRawPartManagerV.xaml | 5 +- .../RawPartManager/RawPartManagerWndV.xaml | 17 +- .../ShowBeamPanel/OnlyProdShowBeamPanelV.xaml | 9 +- .../ShowPanel/OnlyProdShowPanelV.xaml | 8 +- .../SpecialPanel/OnlyProdSpecialPanelV.xaml | 4 +- .../OnlyProdStatisticsTimePanelV.xaml | 20 +- .../TabWnd/ProdWndV.xaml | 21 +- .../TabWnd/ProjWndV.xaml | 31 +- .../Utility/CurrentMachine.vb | 4 +- .../Utility/Dictionary.xaml | 301 +++++++++++++++--- .../ViewPanel/OnlyProdViewPanelV.xaml | 16 +- .../WarehouseWnd/OnlyProdWarehouseWndV.xaml | 39 ++- 32 files changed, 569 insertions(+), 247 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml index 39d4d7ee..23e4e8a4 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/OnlyProdBTLPartManagerV.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Orientation="Horizontal" HorizontalAlignment="Right" + Margin="0,1,30,1" DataContext="{StaticResource BTLPartManagerVM}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml index 41672c92..a415b9d9 100644 --- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/OnlyProdInstrumentPanelV.xaml @@ -3,16 +3,16 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False" - IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}"> + IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml index 729cd8b4..f56accd7 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml @@ -8,19 +8,17 @@ - - - - + + Margin="350,10,0,10"/> @@ -39,6 +37,7 @@ + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml index a0c7a695..63d9d52e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml @@ -1,29 +1,28 @@ - + + Margin="5,5,2.5,20"/> - + - - + diff --git a/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml index 7b8442eb..2c9cf75f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml @@ -1,8 +1,9 @@  + Width="60" + Style="{StaticResource OptionTextBlock_OnlyProd}"/> + Style="{StaticResource OptionTextBlock_OnlyProd}"/> - + Width="60" + Style="{StaticResource OptionTextBlock_OnlyProd}"/> - - - - - + Style="{StaticResource OptionTextBlock_OnlyProd}"/> + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml index a7621ef9..840bc5e7 100644 --- a/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/OnlyProdRawPartManagerV.xaml @@ -1,8 +1,9 @@  + Style="{StaticResource ToolBarOnlyProd_ToggleButton}"> + Style="{StaticResource ToolBarOnlyProd_ToggleButton}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml index 6229e556..6340a7ec 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml @@ -3,20 +3,20 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False" - IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}"> + IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml index 5522ebf5..921330c1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False" - IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}"> + IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> @@ -13,7 +13,7 @@ - diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml index d9addc3c..f7869106 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml @@ -17,8 +17,8 @@ VerticalAlignment="Center" Visibility="{Binding ViewPage_Visibility}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProdWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProdWndV.xaml index 923cb2e2..91e05ffd 100644 --- a/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProdWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/TabWnd/ProdWndV.xaml @@ -27,16 +27,27 @@ - + + + + - + + + + - + Visibility="{Binding Tag.PartManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjWndV}}}"/>--> @@ -28,11 +28,14 @@ + + + Grid.Row="1" + Margin="2,0,2,0"/> - + + + + - + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb b/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb index 2962d1ac..196c9dc3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb @@ -327,8 +327,8 @@ Public Module CurrentMachine ' aggiorno parametro in gestore viste Core.ViewPanelVM.UpdateMachParam(m_nViewDir) ' carico valori default opzioni nesting - Map.refOptimizePanelVM.bLDIntersOther = GetMainPrivateProfileInt(S_NEST, K_LDINTERSOTHER, 0) - Map.refOptimizePanelVM.dMinScore = GetMainPrivateProfileInt(S_NEST, K_MINSCORE, 0) + 'Map.refOptimizePanelVM.bLDIntersOther = GetMainPrivateProfileInt(S_NEST, K_LDINTERSOTHER, 0) + 'Map.refOptimizePanelVM.dMinScore = GetMainPrivateProfileInt(S_NEST, K_MINSCORE, 0) End If End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index f127d0dd..7786b38e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -74,7 +74,11 @@ - + + + + + @@ -123,6 +127,22 @@ + + + + + + + + + + + + + + + + @@ -152,12 +172,20 @@ - - - - - - + + + + + + + + + + + + + + @@ -165,17 +193,16 @@ - + - - + - + @@ -194,7 +221,6 @@ - @@ -211,10 +237,24 @@ + + + - + + + - + @@ -438,9 +488,16 @@ - + + + + + + + + + + + + + + + + + + + + + + + + @@ -1136,10 +1342,10 @@ + - From c1986982eca674bf0577bce4cf301ca7ae9e296a Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 15 May 2024 16:38:48 +0200 Subject: [PATCH 098/126] -aggiunto stile per combobox, expander, listobox --- .../OnlyProdGeneral_ConfigurationPageV.xaml | 5 +- .../MachinePanel/MachinePanelV.xaml | 10 +- .../AddFeatureWnd/NewAddFeatureWndV.xaml | 108 +- .../BTLPartList/OnlyProdBTLPartListV.xaml | 2 +- .../OnlyProdBTLPartManagerV.xaml | 6 +- .../CALCPanel/OnlyProdCalcPanelV.xaml | 51 +- .../ConfigurationPage/ConfigurationPageV.xaml | 18 +- .../OnlyProdConfigurationPageV.xaml | 16 +- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 1 + .../OnlyProdFeatureListManagerV.xaml | 7 +- .../OnlyProdFeatureManagerV.xaml | 85 +- .../OnlyProdFreeContourInputV.xaml | 38 +- .../OnlyProdFreeContourManagerV.xaml | 16 +- .../InputPwdWnd/OnlyProdInputPwdWndV.xaml | 4 +- .../OnlyProdInstrumentPanelV.xaml | 30 +- .../OnlyProdFeatureInPartInRawPartListV.xaml | 2 +- .../ItemParamList/OnlyProdFeatureListV.xaml | 7 +- .../OnlyProdPParameterListV.xaml | 6 +- .../OnlyProdPartInRawPartListV.xaml | 2 +- .../OnlyProdQParameterListProdV.xaml | 4 +- .../OnlyProdQParameterListV.xaml | 4 +- .../ItemParamList/OnlyProdRawPartListV.xaml | 2 +- .../LeftPanel/LeftPanelVM.vb | 5 + .../LeftPanel/OnlyProdLeftPanelV.xaml | 48 +- .../OnlyProdManager/OnlyProdManagerV.xaml | 22 +- .../OnlyProdProject/OnlyProdProjectV.xaml | 36 +- .../OptimizePanel/OnlyProdOptimizePanelV.xaml | 22 +- .../OnlyProdPartInRawPartManagerV.xaml | 6 +- .../PartInRawPartManagerWndV.xaml | 2 +- .../PartManager/OnlyProdPartManagerV.xaml | 180 ++- .../ProdProjManager/ProdProjManagerV.xaml | 1 + .../Project/ProjectVM.vb | 2 +- .../OnlyProdRawPartManagerV.xaml | 18 +- .../RawPartManager/RawPartManagerWndV.xaml | 2 +- .../ShowBeamPanel/OnlyProdShowBeamPanelV.xaml | 10 +- .../ShowPanel/OnlyProdShowPanelV.xaml | 15 +- .../SpecialPanel/OnlyProdSpecialPanelV.xaml | 10 +- .../OnlyProdStatisticsTimePanelV.xaml | 60 +- .../StatusBar/StatusBarV.xaml | 2 +- .../TabWnd/ProdWndV.xaml | 11 +- .../TabWnd/ProjWndV.xaml | 21 +- .../Utility/Dictionary.xaml | 1093 ++++++++++++++--- .../ViewPanel/OnlyProdViewPanelV.xaml | 31 +- 43 files changed, 1313 insertions(+), 708 deletions(-) diff --git a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml index 081a6cd3..232999c8 100644 --- a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml +++ b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml @@ -100,7 +100,8 @@ + SelectedItem="{Binding SelReminder}" + Style="{StaticResource GeneralConfiguration_ComboBox}"/> @@ -109,7 +110,7 @@ Style="{StaticResource ToolBar_TextButton}"/> - @@ -54,16 +51,16 @@ - - diff --git a/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml index e408824e..eaef1273 100644 --- a/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml @@ -40,11 +40,11 @@ Command="{Binding Ok_Command}" IsDefault="True" Grid.Column="1" - Style="{StaticResource EgtWPFLib5_InputButton}"/> + Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/> - + Style="{StaticResource ToolBarViewPanelMAT_Button}"/> + IsEnabled="{Binding Statistics_IsEnabled}" + Style="{StaticResource ToolBarOnlyProdPage_ToggleButton}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml index 9273a04b..fe4827d6 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml @@ -21,7 +21,7 @@ AlternatingRowBackground="{StaticResource BeamWall_LinkWater}" AlternationCount="2" ColumnHeaderBackground="{StaticResource BeamWall_NeonCarrot}" - ColumnHeaderForeground="{StaticResource Omag_White}" + ColumnHeaderForeground="{StaticResource BeamWall_White}" ColumnHeaderHorizontalContentAlignment="Center" ColumnHeaderFontWeight="Bold" ColumnHeaderFontSize="15" diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml index 0834eb82..ec78d158 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml @@ -19,7 +19,7 @@ AlternatingRowBackground="{StaticResource BeamWall_LinkWater}" AlternationCount="2" ColumnHeaderBackground="{StaticResource BeamWall_Keppel}" - ColumnHeaderForeground="{StaticResource Omag_White}" + ColumnHeaderForeground="{StaticResource BeamWall_White}" ColumnHeaderHorizontalContentAlignment="Center" ColumnHeaderFontWeight="Bold" ColumnHeaderFontSize="15" @@ -47,7 +47,7 @@ - + @@ -55,8 +55,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPParameterListV.xaml index ffe1a9f9..51ead55c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPParameterListV.xaml @@ -19,7 +19,7 @@ AlternatingRowBackground="{StaticResource BeamWall_LinkWater}" AlternationCount="2" ColumnHeaderBackground="{StaticResource BeamWall_Downy}" - ColumnHeaderForeground="{StaticResource Omag_White}" + ColumnHeaderForeground="{StaticResource BeamWall_White}" ColumnHeaderHorizontalContentAlignment="Center" ColumnHeaderFontWeight="Bold" ColumnHeaderFontSize="15" @@ -92,7 +92,7 @@ @@ -107,7 +107,7 @@ diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml index 5d5c58a5..d0504be0 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPartInRawPartListV.xaml @@ -23,7 +23,7 @@ AlternatingRowBackground="{StaticResource BeamWall_LinkWater}" AlternationCount="2" ColumnHeaderBackground="{StaticResource BeamWall_Jaffa}" - ColumnHeaderForeground="{StaticResource Omag_White}" + ColumnHeaderForeground="{StaticResource BeamWall_White}" ColumnHeaderHorizontalContentAlignment="Center" ColumnHeaderFontWeight="Bold" ColumnHeaderFontSize="15" diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListProdV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListProdV.xaml index ee5518e5..f213e904 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListProdV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListProdV.xaml @@ -19,7 +19,7 @@ AlternatingRowBackground="{StaticResource BeamWall_LinkWater}" AlternationCount="2" ColumnHeaderBackground="{StaticResource BeamWall_TexasRose}" - ColumnHeaderForeground="{StaticResource Omag_White}" + ColumnHeaderForeground="{StaticResource BeamWall_White}" ColumnHeaderHorizontalContentAlignment="Center" ColumnHeaderFontWeight="Bold" ColumnHeaderFontSize="15" @@ -102,7 +102,7 @@ diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml index 5b8194d4..29a90a28 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml @@ -20,7 +20,7 @@ AlternatingRowBackground="{StaticResource BeamWall_LinkWater}" AlternationCount="2" ColumnHeaderBackground="{StaticResource BeamWall_Downy}" - ColumnHeaderForeground="{StaticResource Omag_White}" + ColumnHeaderForeground="{StaticResource BeamWall_White}" ColumnHeaderHorizontalContentAlignment="Center" ColumnHeaderFontWeight="Bold" ColumnHeaderFontSize="15" @@ -103,7 +103,7 @@ diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml index 8e298940..88c4aabf 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdRawPartListV.xaml @@ -21,7 +21,7 @@ AlternatingRowBackground="{StaticResource BeamWall_LinkWater}" AlternationCount="2" ColumnHeaderBackground="{StaticResource BeamWall_Christine}" - ColumnHeaderForeground="{StaticResource Omag_White}" + ColumnHeaderForeground="{StaticResource BeamWall_White}" ColumnHeaderHorizontalContentAlignment="Center" ColumnHeaderFontWeight="Bold" ColumnHeaderFontSize="15" diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index 712281bf..b6836c14 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -54,6 +54,11 @@ Public Class LeftPanelVM NotifyPropertyChanged(NameOf(Data_IsEnabled)) End Sub + Public ReadOnly Property InstrumentButton_Visibilty As Visibility + Get + Return If(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) + End Get + End Property ' Definizione comandi Private m_cmdData As ICommand diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml index 8c91e1b8..c39132c8 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml @@ -9,38 +9,40 @@ - + + Style="{StaticResource OnlyProdLeftPanel_ListBox}"/> - + + Style="{StaticResource OnlyProdLeftPanel_ListBox}"/> - + + Style="{StaticResource OnlyProdLeftPanel_ListBox}"/> - + + Style="{StaticResource OnlyProdLeftPanel_ListBox}"/> - + + Style="{StaticResource SearchText_TextBox}"/> @@ -49,20 +51,20 @@ - + - + @@ -70,9 +72,9 @@ - diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerV.xaml index 71bf20ba..d006ee44 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerV.xaml @@ -5,20 +5,19 @@ IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False" IsRightDockable="False" IsEnabled="{Binding OnlyProdManager_IsEnabled}" - Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> + Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProdManager}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml index f56accd7..4971a49a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml @@ -13,8 +13,7 @@ + Margin="0,10,0,10" /> + Style="{StaticResource Width_GridSplitter}"/> + @@ -51,11 +49,8 @@ - + @@ -70,13 +65,9 @@ - + Style="{StaticResource OnlyProdOptimizerPanel_Border}"> + Style="{StaticResource Height_GridSplitter}"/> @@ -100,9 +89,7 @@ + Style="{StaticResource Width_GridSplitter}"/> @@ -114,9 +101,8 @@ + Grid.ColumnSpan="2" + Style="{StaticResource Height_GridSplitter}"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml index 63d9d52e..bb7a8be3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OnlyProdOptimizePanelV.xaml @@ -1,28 +1,20 @@  + Style="{StaticResource OptmizePanel_StackPanel}"> + Style="{StaticResource OnlyProdOptimizePanel_ComboBox}"/> - diff --git a/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml index 2c9cf75f..a2f739ce 100644 --- a/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/PartInRawPartManager/OnlyProdPartInRawPartManagerV.xaml @@ -1,10 +1,8 @@  + DataContext="{StaticResource PartInRawPartManagerVM}" + Style="{StaticResource OnlyProdRawPartManager_StackPanel}"> - - - - - - - - - - + Style="{StaticResource OnlyProdCommand_Border}"> + + + + + + + + + + + + + - + Style="{StaticResource OnlyProdUnitTime_Border}"> + + + + + - - + Style="{StaticResource OnlyProdUnitTime_TextBlock}"/> + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdProjManager/ProdProjManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProdProjManager/ProdProjManagerV.xaml index bdfa52bf..fb9f435f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProdProjManager/ProdProjManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ProdProjManager/ProdProjManagerV.xaml @@ -11,6 +11,7 @@ + + DataContext="{StaticResource RawPartManagerVM}" + Style="{StaticResource OnlyProdRawPartManager_StackPanel}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/RawPartManager/RawPartManagerWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/RawPartManagerWndV.xaml index f0a8dcda..c96da813 100644 --- a/EgtBEAMWALL.ViewerOptimizer/RawPartManager/RawPartManagerWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/RawPartManager/RawPartManagerWndV.xaml @@ -8,7 +8,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml index 26f37940..3867fa81 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/OnlyProdShowBeamPanelV.xaml @@ -3,26 +3,26 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False" - IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> + IsRightDockable="False" + Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> + Style="{StaticResource ToolBarOnlyProdPage_ToggleButton}"> + Style="{StaticResource ToolBarOnlyProdPage_ToggleButton}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml index 6340a7ec..1ad6701d 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/OnlyProdShowPanelV.xaml @@ -3,21 +3,22 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False" - IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> + IsRightDockable="False" + Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> + IsChecked="{Binding WireframeIsChecked}" + Style="{StaticResource ToolBarOnlyProdPage_ToggleButton}"> + IsChecked="{Binding HiddenLineIsChecked}" + Style="{StaticResource ToolBarOnlyProdPage_ToggleButton}"> + IsChecked="{Binding ShadingIsChecked}" + Style="{StaticResource ToolBarOnlyProdPage_ToggleButton}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml index 921330c1..a2771d55 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/SpecialPanel/OnlyProdSpecialPanelV.xaml @@ -3,7 +3,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False" - IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> + IsRightDockable="False" + Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> @@ -13,8 +14,11 @@ - diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml index f7869106..49ab3634 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml @@ -8,57 +8,29 @@ IsEnabled="{Binding ProjManager_IsEnabled}" Style="{StaticResource ToolBar_EgtFloatingPanel_OnlyProd}"> - + + Style="{StaticResource OnlyProdStatisticTimePanel_TextBlock}"/> - + + Style="{StaticResource OnlyProdStatisticTimePanel_TextBlock}"/> - + + Style="{StaticResource OnlyProdStatisticTimePanel_TextBlock}"/> - + + Style="{StaticResource OnlyProdStatisticTimePanel_TextBlock}"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/StatusBar/StatusBarV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatusBar/StatusBarV.xaml index 66e3edf6..9d2f300b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatusBar/StatusBarV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/StatusBar/StatusBarV.xaml @@ -45,7 +45,7 @@ From a1b5053ca12aebd24f6903654e34157102a19d8a Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 21 May 2024 17:01:54 +0200 Subject: [PATCH 099/126] - ripristinato grafica versione vecchia programma --- .../General_ConfigurationPageV.xaml | 9 +- .../OnlyProdGeneral_ConfigurationPageV.xaml | 2 +- .../OnlyProdMachine_ConfigurationPageV.xaml | 2 +- .../OnlyProdNewOpenProjectFileDialogV.xaml | 54 +- .../OnlyProdOpenProjectFileDialogV.xaml | 4 +- .../ItemParamList/PartInRawPartListV.xaml | 2 +- .../ItemParamList/RawPartListV.xaml | 2 +- .../AddFeatureWnd/NewAddFeatureWndV.xaml | 8 +- .../AddPartWnd/OnlyProdAddPartWndV.xaml | 78 +- .../AddRawPartWnd/OnlyProdAddRawPartWndV.xaml | 35 +- .../BTLPartList/OnlyProdBTLPartListV.xaml | 44 +- .../OnlyProdBTLPartManagerV.xaml | 20 +- .../OnlyProdConfigurationPageV.xaml | 6 +- .../OnlyProdFeatureListManagerV.xaml | 8 +- .../FreeContourInput/FreeContourInputV.xaml | 2 +- .../InputPwdWnd/OnlyProdInputPwdWndV.xaml | 31 +- .../ItemParamList/BTLPartListV.xaml | 4 + .../FeatureInPartInRawPartListV.xaml | 32 +- .../ItemParamList/FeatureListV.xaml | 6 +- .../OnlyProdFeatureInPartInRawPartListV.xaml | 26 +- .../ItemParamList/OnlyProdFeatureListV.xaml | 29 +- .../OnlyProdPParameterListV.xaml | 12 +- .../OnlyProdPartInRawPartListV.xaml | 6 - .../OnlyProdQParameterListProdV.xaml | 19 +- .../OnlyProdQParameterListV.xaml | 16 +- .../ItemParamList/OnlyProdRawPartListV.xaml | 31 +- .../ItemParamList/PParameterListV.xaml | 6 +- .../ItemParamList/PartInRawPartListV.xaml | 6 +- .../ItemParamList/QParameterListV.xaml | 6 +- .../ItemParamList/RawPartListV.xaml | 6 +- .../LeftPanel/LeftPanelV.xaml | 14 +- .../LeftPanel/OnlyProdLeftPanelV.xaml | 4 +- .../OnlyProdMovePartInRawPartWndV.xaml | 52 +- .../OnlyProdNestingRunningWndV.xaml | 24 +- .../OptimizePanel/OptimizePanelV.xaml | 12 +- .../OnlyProdPartInRawPartManagerV.xaml | 8 +- .../PartManager/PartManagerV.xaml | 10 +- .../OnlyProdProjectTypeWndV.xaml | 79 +- .../OnlyProdRawPartManagerV.xaml | 12 +- .../ShowPanel/ShowPanelV.xaml | 6 +- .../OnlyProdOptimizerStatisticsV.xaml | 6 +- .../Statistics/OnlyProdStatisticsV.xaml | 4 +- .../UpdateBTLWnd/OnlyProdUpdateBTLWndV.xaml | 4 +- .../OnlyProdUpdateOrAppendWndV.xaml | 4 +- .../Utility/Dictionary.xaml | 1362 +++++++++++++++-- .../WarehouseWnd/OnlyProdWarehouseWndV.xaml | 306 ++-- .../WarehouseWnd/WarehouseWndV.xaml | 24 +- 47 files changed, 1724 insertions(+), 719 deletions(-) diff --git a/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml index cb1967d0..3fe2ca1b 100644 --- a/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml +++ b/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml @@ -18,7 +18,8 @@ + Margin="0,0,0,5" + Style="{x:Null}"/> @@ -28,7 +29,8 @@ + Margin="0,5,0,0" + Style="{x:Null}"/> @@ -100,7 +102,8 @@ + SelectedItem="{Binding SelReminder}" + Style="{x:Null}"/> diff --git a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml index 232999c8..baf692af 100644 --- a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml +++ b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml @@ -107,7 +107,7 @@ Orientation="Horizontal"> diff --git a/EgtBEAMWALL.Core/NewOpenProjectFileDialog/OnlyProdNewOpenProjectFileDialogV.xaml b/EgtBEAMWALL.Core/NewOpenProjectFileDialog/OnlyProdNewOpenProjectFileDialogV.xaml index db78187f..6ba1061d 100644 --- a/EgtBEAMWALL.Core/NewOpenProjectFileDialog/OnlyProdNewOpenProjectFileDialogV.xaml +++ b/EgtBEAMWALL.Core/NewOpenProjectFileDialog/OnlyProdNewOpenProjectFileDialogV.xaml @@ -23,8 +23,8 @@ + Visibility="{Binding Filters_Visibility}" + Style="{StaticResource Filters_GroupBox}"> @@ -38,16 +38,14 @@ - + Style="{StaticResource BTLDateTypeList_ComboBox}"/> + - + Style="{StaticResource DayTypeList_ComboBox}"/> + + Style="{StaticResource OnlyProdBTLPartList_CheckBox}"/> @@ -71,20 +69,18 @@ + Style="{StaticResource BTLDateTypeList_ComboBox}"/> + Visibility="{Binding SearchText_Visibility}" + Style="{StaticResource NewSearchText_TextBox}"/> + Style="{StaticResource Configuration_StackPanel}"> + Style="{StaticResource Option_TextBlock}"/> + Style="{StaticResource OnyProd_FeatureComboBox}"/> @@ -124,7 +120,6 @@ + Style="{StaticResource Archived_Image}"/> @@ -171,13 +164,10 @@ + Style="{StaticResource ProjFileList_ItemsControl}"> - + @@ -188,11 +178,10 @@ + Style="{StaticResource Gray_Grid}"/> + Style="{StaticResource OnlyProdNewOpenProjectFileDialog_Grid}"> @@ -227,7 +216,8 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml index 727690dd..8c762873 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml @@ -23,7 +23,7 @@ @@ -40,7 +40,7 @@ @@ -68,7 +68,7 @@ diff --git a/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml index 6009e2cc..ffc7386d 100644 --- a/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/FeatureListManager/OnlyProdFeatureListManagerV.xaml @@ -8,28 +8,28 @@ Visibility="{Binding ViewPage_Visibility}" ToolTip="{Binding CopyFeature_ToolTip}" IsEnabled="{Binding CopyFeature_IsEnabled}" - Style="{StaticResource LeftPanel_Button}"> + Style="{StaticResource OnlyProdLeftPanel_Button}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/FreeContourInput/FreeContourInputV.xaml b/EgtBEAMWALL.ViewerOptimizer/FreeContourInput/FreeContourInputV.xaml index d31388a3..89ac3839 100644 --- a/EgtBEAMWALL.ViewerOptimizer/FreeContourInput/FreeContourInputV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/FreeContourInput/FreeContourInputV.xaml @@ -30,7 +30,7 @@ Visibility="{Binding Check_Visibility}" Margin="5,0,5,0" VerticalAlignment="Center"/> + Visibility="{Binding Combo_Visibility}" Style="{StaticResource ComboItemsList_ComboBox}"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml index eaef1273..5f1196ca 100644 --- a/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml @@ -2,33 +2,30 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" - xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" - Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStyle="None" ResizeMode="NoResize" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterOwner" IsClosable="False" IsMinimizable="False" IsResizable="False" - Title="InputPwdWndV"> - + Title="InputPwdWndV" + Style="{StaticResource OnlyProd_EgtCustomWindow}"> + + - - + + + Style="{StaticResource OnlyProdAddPartWnd_Grid}"> @@ -36,14 +33,14 @@ - diff --git a/EgtBEAMWALL.ViewerOptimizer/MovePartInRawPartWnd/OnlyProdMovePartInRawPartWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/MovePartInRawPartWnd/OnlyProdMovePartInRawPartWndV.xaml index 4578b729..57e3d73f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MovePartInRawPartWnd/OnlyProdMovePartInRawPartWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MovePartInRawPartWnd/OnlyProdMovePartInRawPartWndV.xaml @@ -2,16 +2,16 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" - xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" - Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStyle="None" ResizeMode="NoResize" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterOwner" IsClosable="False" IsMinimizable="False" IsResizable="False" - Title="MovePartInRawPartWndV"> - + Title="MovePartInRawPartWndV" + Style="{StaticResource OnlyProd_EgtCustomWindow}"> + + @@ -19,8 +19,7 @@ - + @@ -30,41 +29,38 @@ - + - + - + + Style="{StaticResource OnlyProdWarehouse_Grid}"> - + Style="{StaticResource MoveDir_TextBlock}"/> + + Style="{StaticResource OnlyProdWarehouse_Grid}"> @@ -73,14 +69,14 @@ - diff --git a/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerV.xaml index c4ffce69..2780a652 100644 --- a/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerV.xaml @@ -36,7 +36,9 @@ UpdateSourceTrigger=Explicit}" Width="65"/> + TextAlignment="Center" + VerticalAlignment="Center" + Margin="10,0,0,3"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowPanel/ShowPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/ShowPanelV.xaml index 34d13116..ba139101 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ShowPanel/ShowPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ShowPanel/ShowPanelV.xaml @@ -6,17 +6,17 @@ IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdOptimizerStatisticsV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdOptimizerStatisticsV.xaml index 3f540164..7040c94b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdOptimizerStatisticsV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdOptimizerStatisticsV.xaml @@ -227,19 +227,19 @@ Grid.Column="2" IsChecked="{Binding bRawPart_IsChecked}" ToolTip="Materials" - Style="{StaticResource ToolBar_ToggleButton}"> + Style="{StaticResource OnlyProdToolBar_ToggleButton}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml index 81bd4e8c..7f42f7c5 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml @@ -169,13 +169,13 @@ diff --git a/EgtBEAMWALL.ViewerOptimizer/UpdateBTLWnd/OnlyProdUpdateBTLWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/UpdateBTLWnd/OnlyProdUpdateBTLWndV.xaml index a1633eb5..27d88183 100644 --- a/EgtBEAMWALL.ViewerOptimizer/UpdateBTLWnd/OnlyProdUpdateBTLWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/UpdateBTLWnd/OnlyProdUpdateBTLWndV.xaml @@ -91,12 +91,12 @@ Command="{Binding Ok_Command}" IsDefault="True" Grid.Column="1" - Style="{StaticResource EgtWPFLib5_InputButton}"/> + Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/> - - + @@ -333,33 +334,34 @@ - - + + - - - - + + @@ -371,57 +373,53 @@ - - + - - + Text="{Binding sNewL, UpdateSourceTrigger=PropertyChanged}" + Style="{StaticResource New_TextBox}"/> + - - + Style="{StaticResource OnlyProdAddPart_Grid}"> - - diff --git a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndV.xaml index a87228b3..326ecacc 100644 --- a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndV.xaml @@ -206,16 +206,20 @@ Style="{StaticResource ToolBar_SmallButton}"/> + ItemsSource="{Binding SParamList}" + SelectedItem="{Binding SelSParam}" + CanUserAddRows="False" + AutoGenerateColumns="False" + CanUserResizeRows="False" + SelectionMode="Single" + ScrollViewer.CanContentScroll="True" + ScrollViewer.VerticalScrollBarVisibility="Auto" + ScrollViewer.HorizontalScrollBarVisibility="Auto" + ColumnHeaderBackground="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" + ColumnHeaderForeground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" + ColumnHeaderFontWeight="Normal" + ColumnHeaderPadding="0,2,0,2" + BindingColumns="{Binding SParamColumns}"> From 14e7c35b6a10cb1a6340d5c1b8acda727dee9b81 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 24 May 2024 12:39:15 +0200 Subject: [PATCH 100/126] -aggiornato grafica in dizionario --- .../OnlyProdGeneral_ConfigurationPageV.xaml | 2 +- .../MachinePanel/MachinePanelV.xaml | 4 +- .../OnlyProdNewOpenProjectFileDialogV.xaml | 12 +- .../FeatureInPartInRawPartListV.xaml | 4 + .../ItemParamList/PartInRawPartListV.xaml | 4 + .../ItemParamList/RawPartListV.xaml | 4 + .../Utility/Dictionary.xaml | 23 +- .../AddFeatureWnd/NewAddFeatureWndV.xaml | 6 +- .../AddPartWnd/OnlyProdAddPartWndV.xaml | 10 +- .../AddRawPartWnd/OnlyProdAddRawPartWndV.xaml | 8 +- .../BTLDataWnd/BTLDataWndV.xaml | 6 +- .../BTLPartList/OnlyProdBTLPartListV.xaml | 8 +- .../ConfigurationPage/ConfigurationPageV.xaml | 6 +- .../OnlyProdConfigurationPageV.xaml | 8 +- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 7 - .../OnlyProdFeatureManagerV.xaml | 6 +- .../FreeContourInput/FreeContourInputV.xaml | 2 +- .../OnlyProdFreeContourInputV.xaml | 6 +- .../InputPwdWnd/OnlyProdInputPwdWndV.xaml | 6 +- .../OnlyProdInstrumentPanelV.xaml | 3 +- .../ItemParamList/BTLDataV.xaml | 6 +- .../ItemParamList/BTLPartListV.xaml | 2 +- .../OnlyProdFeatureInPartInRawPartListV.xaml | 2 +- .../ItemParamList/OnlyProdFeatureListV.xaml | 4 +- .../OnlyProdPParameterListV.xaml | 2 +- .../OnlyProdQParameterListProdV.xaml | 4 +- .../OnlyProdQParameterListV.xaml | 2 +- .../ItemParamList/OnlyProdRawPartListV.xaml | 2 +- .../LeftPanel/OnlyProdLeftPanelV.xaml | 12 +- .../MacroFeatureWnd/NewMacroFeatureWnd.xaml | 9 +- .../MainMenu/OnlyProdMainMenuV.xaml | 31 - .../MainMenu/OnlyProdMainMenuV.xaml.vb | 3 - .../MainWindow/MainWindowVM.vb | 9 - .../OnlyProdMovePartInRawPartWndV.xaml | 12 +- .../OnlyProdProject/OnlyProdProjectV.xaml | 16 +- .../OptimizePanel/OnlyProdOptimizePanelV.xaml | 13 +- .../PartInRawPartManagerWndV.xaml | 2 +- .../PartManager/OnlyProdPartManagerV.xaml | 12 +- .../OnlyProdProjectTypeWndV.xaml | 10 +- .../ProjectTypeWnd/ProjectTypeWndV.xaml | 4 +- .../RawPartManager/RawPartManagerWndV.xaml | 2 +- .../ShowBeamPanel/OnlyProdShowBeamPanelV.xaml | 2 +- .../SpecialPanel/OnlyProdSpecialPanelV.xaml | 2 +- .../TabWnd/ProdWndV.xaml | 2 +- .../TabWnd/ProjWndV.xaml | 6 +- .../Utility/Dictionary.xaml | 3512 ++++++++--------- .../WarehouseWnd/OnlyProdWarehouseWndV.xaml | 14 +- 47 files changed, 1792 insertions(+), 2040 deletions(-) delete mode 100644 EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml delete mode 100644 EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml.vb diff --git a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml index baf692af..1d6e68ca 100644 --- a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml +++ b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml @@ -101,7 +101,7 @@ + Margin="0,0,0,5"/> diff --git a/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml b/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml index b02939f5..96ecfde7 100644 --- a/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml +++ b/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml @@ -29,13 +29,13 @@ Style="{StaticResource GeneralConfigurationToolBar_TextButton}" Content="{Binding SetUpMsg}" Visibility="{Binding SetUp_Visibility}"/> + + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml new file mode 100644 index 00000000..6dadb6be --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml.vb new file mode 100644 index 00000000..4769b408 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml.vb @@ -0,0 +1,12 @@ +Public Class OnlyProdPDFEditorV + + Sub New() + + ' La chiamata è richiesta dalla finestra di progettazione. + InitializeComponent() + + ' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent(). + DataContext = New PDFEditorVM() + End Sub + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml index 49ab3634..9c72454b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/OnlyProdStatisticsTimePanelV.xaml @@ -10,7 +10,7 @@ + Style="{StaticResource OnlyProdTotalTimeOTT_Border}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index 0d3a6a39..872fc790 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -1334,6 +1334,9 @@ + + @@ -1969,11 +1972,6 @@ - - @@ -2338,6 +2336,9 @@ + + + + + + + + + + @@ -2801,18 +2828,6 @@ - - - - From f8a9eb544d9d5f9fdc4ddce93291acbb26d1a04a Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 31 May 2024 15:29:46 +0200 Subject: [PATCH 102/126] -aggiunto stile tooltip, listbox --- ...OnlyProdQParameter_ConfigurationPageV.xaml | 6 +- .../ItemParamList/QParamListV.xaml | 33 ++- .../BTLDataWnd/BTLDataWndV.xaml | 92 +++---- .../BTLPartList/OnlyProdBTLPartListV.xaml | 3 +- .../BTLViewModel/BTLStructureVM.vb | 12 +- .../ItemParamList/OnlyProdFeatureListV.xaml | 2 +- .../OnlyProdPParameterListV.xaml | 2 +- .../OnlyProdQParameterListProdV.xaml | 2 +- .../OnlyProdQParameterListV.xaml | 2 +- .../LeftPanel/LeftPanelVM.vb | 9 +- .../LeftPanel/OnlyProdLeftPanelV.xaml | 8 +- .../OnlyProdProject/OnlyProdProjectV.xaml | 3 +- .../OptimizePanel/OptimizePanelVM.vb | 5 - .../PartParametersWnd/PartParametersWndV.xaml | 250 +++++++++--------- .../TabWnd/ProjWndV.xaml | 4 +- .../Utility/CurrentMachine.vb | 4 +- .../Utility/Dictionary.xaml | 24 +- 17 files changed, 249 insertions(+), 212 deletions(-) diff --git a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml index 301d3bdc..0e15d8e6 100644 --- a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml +++ b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdQParameter_ConfigurationPageV.xaml @@ -34,13 +34,13 @@ - + - + @@ -57,7 +57,7 @@ - + diff --git a/EgtBEAMWALL.Core/ItemParamList/QParamListV.xaml b/EgtBEAMWALL.Core/ItemParamList/QParamListV.xaml index 79c800d6..1a62912f 100644 --- a/EgtBEAMWALL.Core/ItemParamList/QParamListV.xaml +++ b/EgtBEAMWALL.Core/ItemParamList/QParamListV.xaml @@ -11,14 +11,16 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Margin="0,0,0,5" - Style="{StaticResource DataGrid_OnlyProd}"> - + Style="{StaticResource DataGrid_OnlyProd}" + RowStyle="{StaticResource RowDataGrid_CustomHighLight}" + CellStyle="{StaticResource CellDataGrid_CustomHighLight}"> + Width="40" + IsReadOnly="True" + Foreground="{StaticResource BeamWall_Corduroy}"> @@ -27,8 +29,9 @@ + Width="50" + IsReadOnly="True" + Foreground="{StaticResource BeamWall_Corduroy}"> @@ -37,8 +40,9 @@ + Width="1*" + IsReadOnly="True" + Foreground="{StaticResource BeamWall_Corduroy}"> @@ -47,7 +51,8 @@ + Width="65" + Foreground="{StaticResource BeamWall_Corduroy}"> @@ -56,8 +61,9 @@ + Width="65" + IsReadOnly="True" + Foreground="{StaticResource BeamWall_Corduroy}"> @@ -66,8 +72,9 @@ + Width="65" + IsReadOnly="True" + Foreground="{StaticResource BeamWall_Corduroy}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLDataWnd/BTLDataWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/BTLDataWnd/BTLDataWndV.xaml index e9a607b3..d6002945 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLDataWnd/BTLDataWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/BTLDataWnd/BTLDataWndV.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" - Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStyle="None" ResizeMode="NoResize" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterOwner" @@ -11,148 +10,149 @@ IsMinimizable="False" IsResizable="False" Title="BTLDataWndV" - Name="BTLDataWndV"> + Name="BTLDataWndV" + Style="{StaticResource OnlyProd_EgtCustomWindow}"> - - - - - - - - - + - - - - - - - - - - - - diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml index 0520586f..657aa178 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml @@ -121,7 +121,8 @@ + VerticalAlignment="Center" + HorizontalAlignment="Center"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb index 7521f7ca..5ab137d3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb @@ -84,7 +84,11 @@ Public Class BTLStructureVM Select Case m_SelectionType Case SelectionTypes.SELECT_ ' imposto modalita' proj su vista feature - If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.PROJ + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + Map.refProdProjManagerVM.SelProdProj = ProdProj.PROJ + ' rendo visibile PartManager + Map.refLeftPanelVM.OnlyProdPartManagerVisibility = Visibility.Visible + End If ' rendo enable bottone parameters Map.refLeftPanelVM.SetParametersIsEnabled(True) Map.refLeftPanelVM.SetData_IsEnabled(False) @@ -97,7 +101,11 @@ Public Class BTLStructureVM Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility)) Case SelectionTypes.HIGHLIGHT ' imposto modalita' nulla su vista feature - If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.NULL + If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + Map.refProdProjManagerVM.SelProdProj = ProdProj.NULL + ' rendo visibile PartManager + Map.refLeftPanelVM.OnlyProdPartManagerVisibility = Visibility.Collapsed + End If ' rendo disable bottone parameters Map.refLeftPanelVM.SetParametersIsEnabled(False) Map.refLeftPanelVM.SetData_IsEnabled(True) diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml index ea405899..5cb3ffde 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdFeatureListV.xaml @@ -78,7 +78,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPParameterListV.xaml index 68c0b300..957a948e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdPParameterListV.xaml @@ -67,7 +67,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListProdV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListProdV.xaml index 217fbfc5..a9b8a8d9 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListProdV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListProdV.xaml @@ -69,7 +69,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml index 5fff2069..ee0de37d 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml @@ -69,7 +69,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index b6836c14..18fa7e1f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -54,10 +54,15 @@ Public Class LeftPanelVM NotifyPropertyChanged(NameOf(Data_IsEnabled)) End Sub - Public ReadOnly Property InstrumentButton_Visibilty As Visibility + Private m_OnlyProdPartManagerVisibility As Visibility = Visibility.Collapsed + Public Property OnlyProdPartManagerVisibility As Visibility Get - Return If(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) + Return m_OnlyProdPartManagerVisibility End Get + Set(value As Visibility) + m_OnlyProdPartManagerVisibility = value + NotifyPropertyChanged(NameOf(OnlyProdPartManagerVisibility)) + End Set End Property ' Definizione comandi diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml index 0300a265..eef59a03 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml @@ -15,7 +15,8 @@ + Style="{StaticResource OnlyProdLeftPanel_ListBox}" + ItemContainerStyle="{StaticResource AlternatingWithTriggers}"/> @@ -80,6 +79,7 @@ + Tag="{Binding Tag.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdLeftPanelV}}}" + Visibility="{Binding DataContext.OnlyProdPartManagerVisibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdLeftPanelV}}}"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml index 61fd82ab..4999d393 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdProject/OnlyProdProjectV.xaml @@ -43,7 +43,8 @@ Visibility="{Binding DataContext.OnlyProdLeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/> + Style="{StaticResource Width_GridSplitter}" + Background="Transparent"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb index 07bc47d7..24f8990a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb @@ -258,11 +258,6 @@ Public Class OptimizePanelVM ' se vista tutti i pezzi Dim bShowBuilding As Boolean = False Configuration.ShowAllPieces(bShowBuilding) - 'If Map.refShowBeamPanelVM.bShowAll Then - ' ' verifico se assemblato e lo annullo per salvataggio - ' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked - ' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) - 'End If Dim NestingRunningWndVM As New NestingRunningWndVM(m_SelPartType.Id, BTLPart) Dim NestingRunningWnd As New NestingRunningWndV(Application.Current.MainWindow, NestingRunningWndVM) NestingRunningWnd.ShowDialog() diff --git a/EgtBEAMWALL.ViewerOptimizer/PartParametersWnd/PartParametersWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/PartParametersWnd/PartParametersWndV.xaml index 7d0320d9..bafc6585 100644 --- a/EgtBEAMWALL.ViewerOptimizer/PartParametersWnd/PartParametersWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/PartParametersWnd/PartParametersWndV.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" - Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStyle="None" ResizeMode="NoResize" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterOwner" @@ -11,7 +10,8 @@ IsMinimizable="False" IsResizable="False" Title="PartParametersWndV" - Name="PartParametersWndV"> + Name="PartParametersWndV" + Style="{StaticResource OnlyProd_EgtCustomWindow}"> @@ -25,73 +25,73 @@ - - - - - - - - - - - - + @@ -101,24 +101,24 @@ - - + + + diff --git a/EgtBEAMWALL.Supervisor/CALCPanel/OnlyProdCalcPanelV.xaml.vb b/EgtBEAMWALL.Supervisor/CALCPanel/OnlyProdCalcPanelV.xaml.vb new file mode 100644 index 00000000..79f7176f --- /dev/null +++ b/EgtBEAMWALL.Supervisor/CALCPanel/OnlyProdCalcPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdCalcPanelV + +End Class diff --git a/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb index 59b404f7..88fbb2fe 100644 --- a/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb +++ b/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb @@ -20,11 +20,10 @@ Public Class ConfigurationPageVM Set(value As Integer) m_SelConfigSubPage = value If m_SelConfigSubPage = ConfigSubPages.GENERAL Then - m_bGeneral_Visibility = Visibility.Visible + SetGeneral_Visibility(Visibility.Visible) ElseIf m_SelConfigSubPage = ConfigSubPages.MACHINE Then - m_bGeneral_Visibility = Visibility.Collapsed + SetGeneral_Visibility(Visibility.Collapsed) End If - NotifyPropertyChanged(NameOf(General_Visibility)) End Set End Property @@ -109,26 +108,26 @@ Public Class ConfigurationPageVM End Property Private m_bGeneral_Visibility As Visibility = Visibility.Visible - Public Property General_Visibility As Visibility + Public ReadOnly Property General_Visibility As Visibility Get Return m_bGeneral_Visibility End Get - Set(value As Visibility) - m_bGeneral_Visibility = value - NotifyPropertyChanged(NameOf(General_Visibility)) - End Set End Property + Friend Sub SetGeneral_Visibility(value As Visibility) + m_bGeneral_Visibility = value + NotifyPropertyChanged(NameOf(General_Visibility)) + End Sub Private m_bMachine_Visibility As Visibility = Visibility.Collapsed - Public Property Machine_Visibility As Visibility + Public ReadOnly Property Machine_Visibility As Visibility Get Return m_bMachine_Visibility End Get - Set(value As Visibility) - m_bMachine_Visibility = value - NotifyPropertyChanged(NameOf(Machine_Visibility)) - End Set End Property + Friend Sub SetMachine_Visibility(value As Visibility) + m_bMachine_Visibility = value + NotifyPropertyChanged(NameOf(Machine_Visibility)) + End Sub Private m_SectionTime As Double Public Property SectionTime As String @@ -185,15 +184,15 @@ Public Class ConfigurationPageVM End Property Private m_MachineParameter_Visibility As Visibility = Visibility.Collapsed - Public Property MachineParameter_Visibility As Visibility + Public ReadOnly Property MachineParameter_Visibility As Visibility Get Return m_MachineParameter_Visibility End Get - Set(value As Visibility) - m_MachineParameter_Visibility = value - NotifyPropertyChanged(NameOf(MachineParameter_Visibility)) - End Set End Property + Friend Sub SetMachineParameter_Visibility(value As Visibility) + m_MachineParameter_Visibility = value + NotifyPropertyChanged(NameOf(MachineParameter_Visibility)) + End Sub ' Definizione comandi Private m_cmdSave As ICommand @@ -402,10 +401,8 @@ Public Class ConfigurationPageVM Dim nDefaultReminderFrequency As Integer = GetMainPrivateProfileInt(S_BACKUPANDRESTORE, K_REMINDERFREQUENCY, 1) SelReminder = m_ReminderList.FirstOrDefault(Function(x) x.Id = nDefaultReminderFrequency) ' rendo invisibile la sezione Offset presente nel tab Macchine - m_MachineParameter_Visibility = Visibility.Collapsed - m_bMachine_Visibility = Visibility.Collapsed - NotifyPropertyChanged(NameOf(MachineParameter_Visibility)) - NotifyPropertyChanged(NameOf(Machine_Visibility)) + SetMachineParameter_Visibility(Visibility.Collapsed) + SetMachine_Visibility(Visibility.Collapsed) End Sub #End Region ' Constructor diff --git a/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj b/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj index c14cb222..bb3c5780 100644 --- a/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj +++ b/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj @@ -211,6 +211,7 @@ ..\packages\NLog.5.0.1\lib\net46\NLog.dll + ..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll @@ -318,16 +319,31 @@ AxesPanelV.xaml + + OnlyProdAxesPanelV.xaml + CalcPanelV.xaml + + OnlyProdCalcPanelV.xaml + + + OnlyProdPartInRawPartListV.xaml + + + OnlyProdRawPartListV.xaml + + + OnlyProdLeftPanelV.xaml + MachineLogPageV.xaml @@ -386,6 +402,9 @@ + + OnlyProdProjectV.xaml + ProjectV.xaml @@ -394,6 +413,9 @@ SceneHostV.xaml + + OnlyProdShowPanelV.xaml + ShowPanelV.xaml @@ -401,6 +423,9 @@ StatusBarV.xaml + + OnlyProdSupervisorManagerV.xaml + SupervisorManagerV.xaml @@ -422,6 +447,9 @@ + + OnlyProdViewPanelV.xaml + ViewPanelV.xaml @@ -438,10 +466,30 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -498,6 +546,10 @@ MainWindowV.xaml Code + + Designer + MSBuild:Compile + Designer XamlIntelliSenseFileGenerator @@ -506,6 +558,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -514,6 +570,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -526,6 +586,10 @@ Designer XamlIntelliSenseFileGenerator + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdPartInRawPartListV.xaml b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdPartInRawPartListV.xaml new file mode 100644 index 00000000..814ddc0e --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdPartInRawPartListV.xaml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdPartInRawPartListV.xaml.vb b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdPartInRawPartListV.xaml.vb new file mode 100644 index 00000000..d2f5a3d3 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdPartInRawPartListV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdPartInRawPartListV + +End Class diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdRawPartListV.xaml b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdRawPartListV.xaml new file mode 100644 index 00000000..0947548e --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdRawPartListV.xaml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdRawPartListV.xaml.vb b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdRawPartListV.xaml.vb new file mode 100644 index 00000000..a800da9d --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdRawPartListV.xaml.vb @@ -0,0 +1,45 @@ +Imports EgtBEAMWALL.Core +Imports System.ComponentModel + +Public Class OnlyProdRawPartListV + + Sub New() + + ' This call is required by the designer. + InitializeComponent() + + ' Add any initialization after the InitializeComponent() call. + MyComparer.SetDataGrid(MachGroupDataGrid) + AddHandler MachGroupDataGrid.ResetSort, AddressOf MachGroupDataGrid_ResetSort + End Sub + + ' funzione che permette di selezionare un RawPart anche quando gia' selezionato + Private Sub RawPartRow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + If TypeOf sender Is DataGridRow Then + Dim Row As DataGridRow = DirectCast(sender, DataGridRow) + Dim RowVM As MyMachGroupVM = DirectCast(Row.DataContext, MyMachGroupVM) + ' se gia' selezionato rifaccio selezione perche' potrbbe essere selezionato un BTLPart + If Not IsNothing(Row) AndAlso Row.IsSelected Then + Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup + End If + End If + End Sub + + Private Sub MachGroupVMList_Sorting(sender As Object, e As DataGridSortingEventArgs) + ' aggiorno direziona colonna + Dim column As DataGridColumn = e.Column + column.SortDirection = If((column.SortDirection <> ListSortDirection.Ascending), ListSortDirection.Ascending, ListSortDirection.Descending) + ' ricalcolo colonne sort + Dim datagrid As DataGrid = sender + MyComparer.RefreshColumns() + ' lancio sort custom + Map.refSupervisorMachGroupPanelVM.RefreshMachGroupVMSort() + e.Handled = True + End Sub + + Private Sub MachGroupDataGrid_ResetSort() + MyComparer.RefreshColumns() + Map.refSupervisorMachGroupPanelVM.RefreshMachGroupVMSort() + End Sub + +End Class diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml new file mode 100644 index 00000000..4718314b --- /dev/null +++ b/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml.vb b/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml.vb new file mode 100644 index 00000000..c991aa65 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdLeftPanelV + +End Class diff --git a/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb b/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb index e2386272..52ba33eb 100644 --- a/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb +++ b/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb @@ -361,8 +361,8 @@ Public Class MachinePanelVM End Property Public Sub ParameterMachineVisibility() - Map.refConfigurationPageVM.MachineParameter_Visibility = Visibility.Visible - Map.refConfigurationPageVM.Machine_Visibility = Visibility.Visible + Map.refConfigurationPageVM.SetMachineParameter_Visibility(Visibility.Visible) + Map.refConfigurationPageVM.SetMachine_Visibility(Visibility.Visible) End Sub #End Region ' ParameterMachine diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowV.xaml b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowV.xaml index 560b1c1a..48be20bf 100644 --- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowV.xaml +++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowV.xaml @@ -30,7 +30,8 @@ - + + diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb index 6471ce05..94b89087 100644 --- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb @@ -41,6 +41,12 @@ Public Class MainWindowVM End Set End Property + Public ReadOnly Property ProjectContent As Object + Get + Return If(Map.refMainWindowVM.MainWindowM.bOnlyProd, New OnlyProdProjectV(), New ProjectV()) + End Get + End Property + ' Definizione comandi Private m_cmdAboutBox As ICommand Private m_cmdCloseApplication As ICommand diff --git a/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml b/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml new file mode 100644 index 00000000..55c974d6 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml.vb b/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml.vb new file mode 100644 index 00000000..b60c4a3d --- /dev/null +++ b/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdProjectV + +End Class diff --git a/EgtBEAMWALL.Supervisor/Project/ProjectV.xaml b/EgtBEAMWALL.Supervisor/Project/ProjectV.xaml index cabcc68e..b35069a5 100644 --- a/EgtBEAMWALL.Supervisor/Project/ProjectV.xaml +++ b/EgtBEAMWALL.Supervisor/Project/ProjectV.xaml @@ -3,12 +3,12 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" - xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor"> + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor" + DataContext="{StaticResource ProjectVM}"> - + @@ -19,9 +19,9 @@ + DataContext="{StaticResource LeftPanelVM}" + Tag="{Binding DataContext.SupervisorMachGroupPanelVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}" + Visibility="{Binding DataContext.LeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/> @@ -75,11 +75,11 @@ - + + + + + diff --git a/EgtBEAMWALL.Supervisor/SupervisorManager/OnlyProdSupervisorManagerV.xaml.vb b/EgtBEAMWALL.Supervisor/SupervisorManager/OnlyProdSupervisorManagerV.xaml.vb new file mode 100644 index 00000000..ab29826c --- /dev/null +++ b/EgtBEAMWALL.Supervisor/SupervisorManager/OnlyProdSupervisorManagerV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdSupervisorManagerV + +End Class diff --git a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerV.xaml b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerV.xaml index a70f8630..54c81cfc 100644 --- a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerV.xaml +++ b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerV.xaml @@ -18,7 +18,7 @@ @@ -32,5 +32,4 @@ - diff --git a/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml b/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml index 58560cf3..b5fce909 100644 --- a/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml @@ -1,11 +1,13 @@ - + + + + + + + @@ -62,6 +67,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -89,32 +168,42 @@ - + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -195,6 +575,9 @@ @@ -429,7 +815,7 @@ - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Supervisor/ViewPanel/OnlyProdViewPanelV.xaml b/EgtBEAMWALL.Supervisor/ViewPanel/OnlyProdViewPanelV.xaml new file mode 100644 index 00000000..80740a51 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ViewPanel/OnlyProdViewPanelV.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + diff --git a/EgtBEAMWALL.Supervisor/ViewPanel/OnlyProdViewPanelV.xaml.vb b/EgtBEAMWALL.Supervisor/ViewPanel/OnlyProdViewPanelV.xaml.vb new file mode 100644 index 00000000..366de359 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ViewPanel/OnlyProdViewPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdViewPanelV + +End Class diff --git a/EgtBEAMWALL.Supervisor/ViewPanel/ViewPanelV.xaml b/EgtBEAMWALL.Supervisor/ViewPanel/ViewPanelV.xaml index 0caf70a0..cab9c958 100644 --- a/EgtBEAMWALL.Supervisor/ViewPanel/ViewPanelV.xaml +++ b/EgtBEAMWALL.Supervisor/ViewPanel/ViewPanelV.xaml @@ -1,9 +1,9 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" + IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False" + IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}"> + VerticalAlignment="Center" + Background="Transparent" + BorderBrush="Transparent" + Foreground="{StaticResource BeamWall_Kashmir}"> + FontWeight="Bold" + Margin="0,-5,0,-2"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml index ee0de37d..b4d89051 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdQParameterListV.xaml @@ -42,7 +42,8 @@ + VerticalAlignment="Center" + HorizontalAlignment="Center"/> @@ -67,7 +68,7 @@ + Style="{StaticResource OnlyProd_TextBlock}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index 18fa7e1f..ef0210bf 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -55,15 +55,15 @@ Public Class LeftPanelVM End Sub Private m_OnlyProdPartManagerVisibility As Visibility = Visibility.Collapsed - Public Property OnlyProdPartManagerVisibility As Visibility + Public ReadOnly Property OnlyProdPartManagerVisibility As Visibility Get Return m_OnlyProdPartManagerVisibility End Get - Set(value As Visibility) - m_OnlyProdPartManagerVisibility = value - NotifyPropertyChanged(NameOf(OnlyProdPartManagerVisibility)) - End Set End Property + Friend Sub SetOnlyProdPartManager_Visibility(value As Visibility) + m_OnlyProdPartManagerVisibility = value + NotifyPropertyChanged(NameOf(OnlyProdPartManagerVisibility)) + End Sub ' Definizione comandi Private m_cmdData As ICommand @@ -73,7 +73,7 @@ Public Class LeftPanelVM Public ReadOnly Property SearchFilter_Msg As String Get - Return "Search & Filter" + Return EgtMsg(61949) End Get End Property diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml index eef59a03..9d23e595 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/OnlyProdLeftPanelV.xaml @@ -11,6 +11,13 @@ + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml.vb new file mode 100644 index 00000000..61ae84b7 --- /dev/null +++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdMainMenuV + +End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml.vb index 7395aaf1..0d065cb1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml.vb +++ b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml.vb @@ -7,22 +7,6 @@ Imports Windows.Storage.Streams Partial Public Class PdfViewer Inherits UserControl - 'Public Property PdfPath As String - ' Get - ' Return CStr(GetValue(PdfPathProperty)) - ' End Get - ' Set(value As String) - ' SetValue(PdfPathProperty, value) - ' End Set - 'End Property - - 'Private Shared m_Items As New List(Of Image) - 'Public Shared ReadOnly Property Items As List(Of Image) - ' Get - ' Return m_Items - ' End Get - 'End Property - Public Property PdfPath As String Get Return CStr(GetValue(PdfPathProperty)) @@ -32,11 +16,6 @@ Partial Public Class PdfViewer End Set End Property - 'Public Shared ReadOnly PdfPathProperty As DependencyProperty = DependencyProperty.Register("PdfPath", - ' GetType(String), - ' GetType(PdfViewer), - ' New FrameworkPropertyMetadata(String.Empty, New PropertyChangedCallback(AddressOf OnPdfPathChanged))) - Public Shared ReadOnly PdfPathProperty As DependencyProperty = DependencyProperty.Register("PdfPath", GetType(String), GetType(PdfViewer), @@ -51,43 +30,10 @@ Partial Public Class PdfViewer End If End Sub - 'Private Shared Sub OnPdfPathChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs) - ' Dim pdfDrawer As PdfViewer = CType(d, PdfViewer) - ' If Not String.IsNullOrEmpty(pdfDrawer.PdfPath) Then - ' Dim path = System.IO.Path.GetFullPath(pdfDrawer.PdfPath) - ' StorageFile.GetFileFromPathAsync(path).AsTask().ContinueWith(Function(t) PdfDocument.LoadFromFileAsync(t.Result).AsTask()).Unwrap().ContinueWith(Function(t2) PdfToImages(t2.Result), TaskScheduler.FromCurrentSynchronizationContext()) - ' End If - 'End Sub - Sub New() InitializeComponent() End Sub - '''' - '''' Funzione che trasforma le pagine del pdf in immagine - '''' - '''' Singola pagina del PDf - '''' - 'Private Shared Async Function PdfToImages(pdfDoc As PdfDocument) As Task - ' 'Dim items As ItemCollection = pdfViewer.PagesContainer.Items - ' Items.Clear() - - ' If IsNothing(pdfDoc) Then Return - - ' For i As Integer = 0 To pdfDoc.PageCount - 1 - ' Using page As PdfPage = pdfDoc.GetPage(i) - ' Dim bitmap As BitmapImage = Await PageToBitmapAsync(page) - ' Dim image As New Image With { - ' .Source = bitmap, - ' .HorizontalAlignment = HorizontalAlignment.Center, - ' .Width = bitmap.Width, - ' .Height = bitmap.Height - ' } - ' Items.Add(image) - ' End Using - ' Next - 'End Function - ''' ''' Funzione che trasforma le pagine del pdf in immagine ''' diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdProjManager/ProdProjManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProdProjManager/ProdProjManagerV.xaml index fb9f435f..834c326e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProdProjManager/ProdProjManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ProdProjManager/ProdProjManagerV.xaml @@ -4,6 +4,13 @@ xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" DataContext="{StaticResource ProdProjManagerVM}" SelectedIndex="{Binding SelProdProj}"> + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -1836,50 +1904,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2175,21 +2150,16 @@ - - - - - - - - - - - - @@ -2435,48 +2366,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -57,7 +66,7 @@ @@ -67,7 +76,7 @@ diff --git a/EgtBEAMWALL.Core/MachinePanel/OnlyProdMachinePanelV.xaml b/EgtBEAMWALL.Core/MachinePanel/OnlyProdMachinePanelV.xaml index 41861117..58e4584a 100644 --- a/EgtBEAMWALL.Core/MachinePanel/OnlyProdMachinePanelV.xaml +++ b/EgtBEAMWALL.Core/MachinePanel/OnlyProdMachinePanelV.xaml @@ -24,23 +24,29 @@ Style="{StaticResource OnlyProdCalcPanel_ComboBox}"/> - - + - - - - diff --git a/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb index 88fbb2fe..678bbccc 100644 --- a/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb +++ b/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageVM.vb @@ -183,7 +183,7 @@ Public Class ConfigurationPageVM End Set End Property - Private m_MachineParameter_Visibility As Visibility = Visibility.Collapsed + Friend m_MachineParameter_Visibility As Visibility = Visibility.Collapsed Public ReadOnly Property MachineParameter_Visibility As Visibility Get Return m_MachineParameter_Visibility diff --git a/EgtBEAMWALL.Supervisor/ConfigurationPage/OnlyProdConfigurationPageV.xaml b/EgtBEAMWALL.Supervisor/ConfigurationPage/OnlyProdConfigurationPageV.xaml new file mode 100644 index 00000000..777a943d --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ConfigurationPage/OnlyProdConfigurationPageV.xaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Supervisor/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb b/EgtBEAMWALL.Supervisor/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb new file mode 100644 index 00000000..f5f6e989 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb @@ -0,0 +1,3 @@ +Class OnlyProdConfigurationPageV + +End Class diff --git a/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj b/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj index bb3c5780..989af576 100644 --- a/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj +++ b/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj @@ -334,7 +334,13 @@ + + OnlyProdConfigurationPageV.xaml + + + OnlyProdFeatureInPartInRawPartListV.xaml + OnlyProdPartInRawPartListV.xaml @@ -344,6 +350,9 @@ OnlyProdLeftPanelV.xaml + + OnlyProdMachCommandMessagePanelV.xaml + MachineLogPageV.xaml @@ -478,6 +487,14 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -490,6 +507,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml new file mode 100644 index 00000000..06f28f05 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb new file mode 100644 index 00000000..f0123c83 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/ItemParamList/OnlyProdFeatureInPartInRawPartListV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdFeatureInPartInRawPartListV + +End Class diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml b/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml index 4718314b..385a7eb9 100644 --- a/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml +++ b/EgtBEAMWALL.Supervisor/LeftPanel/OnlyProdLeftPanelV.xaml @@ -30,7 +30,7 @@ + Margin="0,10,0,5"> @@ -50,7 +50,7 @@ Visibility="{Binding E80002_Visibility}"/> + Margin="0,15,0,2"> @@ -63,7 +63,7 @@ - + + Margin="2.5,0,5,0"/> - + - + Margin="2.5,0,5,0"/> + diff --git a/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelV.xaml b/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelV.xaml index de06218b..cec04cd7 100644 --- a/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelV.xaml +++ b/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelV.xaml @@ -39,7 +39,8 @@ Command="{Binding DeleteAlarms_Command}" Visibility="{Binding DeleteAlarm_Visibility}" Style="{StaticResource ToolBar_TextButton}" - IsEnabled="{Binding CommBtn_IsEnabled}"/> + IsEnabled="{Binding CommBtn_IsEnabled}" + Width="100"/> diff --git a/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/OnlyProdMachCommandMessagePanelV.xaml b/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/OnlyProdMachCommandMessagePanelV.xaml new file mode 100644 index 00000000..246f3917 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/OnlyProdMachCommandMessagePanelV.xaml @@ -0,0 +1,49 @@ + + + + + + + + + - + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml index 12a89163..f6c8517e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdPDFEditorV.xaml @@ -132,10 +132,15 @@
- + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml index 7f42f7c5..cf36a8fb 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OnlyProdStatisticsV.xaml @@ -19,7 +19,18 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" - BindingColumns="{Binding StatisticsColumns}"> + BindingColumns="{Binding StatisticsColumns}" + AlternatingRowBackground="{StaticResource BeamWall_LinkWater}" + AlternationCount="2" + ColumnHeaderBackground="{StaticResource BeamWall_Teal}" + ColumnHeaderForeground="{StaticResource BeamWall_White}" + ColumnHeaderHorizontalContentAlignment="Center" + ColumnHeaderFontWeight="Bold" + ColumnHeaderFontSize="15" + ColumnHeaderPadding="0,2,0,2" + CellStyle="{StaticResource CellDataGrid_CustomHighLight}" + RowStyle="{StaticResource RowDataGrid_CustomHighLight}" + Style="{StaticResource DataGrid_OnlyProd}"> @@ -138,46 +149,51 @@ - + - - - - + + + + RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdStatisticsV}}}" + Margin="10,5,5,5"/> - - + + + RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdStatisticsV}}}" + Margin="10,5,5,5"/> - - + + + RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdStatisticsV}}}" + Margin="10,5,5,5"/> - - + + + RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdStatisticsV}}}" + Margin="10,5,5,5"/> - - + + diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/StatisticsTimePanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/StatisticsTimePanelVM.vb index be6b03b0..eb9af7ab 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/StatisticsTimePanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsTimePanel/StatisticsTimePanelVM.vb @@ -10,20 +10,8 @@ Public Class StatisticsTimePanelVM #Region "FIELDS & PROPERTIES" - 'Public ReadOnly Property ViewPage_Visibility As Visibility - ' Get - ' Return If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) - ' End Get - 'End Property - - 'Public ReadOnly Property MachiningPage_Visibility As Visibility - ' Get - ' Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed) - ' End Get - 'End Property - Private m_ViewPage_Visibility As Visibility = Visibility.Collapsed - Public Property ViewPage_Visibility As Visibility + Public ReadOnly Property ViewPage_Visibility As Visibility Get If Map.refMainMenuVM.SelPage = Pages.VIEW Then Return Visibility.Visible @@ -31,14 +19,14 @@ Public Class StatisticsTimePanelVM Return m_ViewPage_Visibility End If End Get - Set(value As Visibility) - m_ViewPage_Visibility = value - NotifyPropertyChanged(NameOf(ViewPage_Visibility)) - End Set End Property + Friend Sub SetViewPage_Visibility(value As Visibility) + m_ViewPage_Visibility = value + NotifyPropertyChanged(NameOf(ViewPage_Visibility)) + End Sub Private m_MachiningPage_Visibility As Visibility = Visibility.Collapsed - Public Property MachiningPage_Visibility As Visibility + Public ReadOnly Property MachiningPage_Visibility As Visibility Get If Map.refMainMenuVM.SelPage = Pages.MACHINING Then Return Visibility.Visible @@ -46,11 +34,11 @@ Public Class StatisticsTimePanelVM Return m_MachiningPage_Visibility End If End Get - Set(value As Visibility) - m_MachiningPage_Visibility = value - NotifyPropertyChanged(NameOf(MachiningPage_Visibility)) - End Set End Property + Friend Sub SetMachiningPage_Visibility(value As Visibility) + m_MachiningPage_Visibility = value + NotifyPropertyChanged(NameOf(MachiningPage_Visibility)) + End Sub #Region "ToolTip" diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml index dc6a6d6b..46e6c783 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml @@ -4,7 +4,7 @@ xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" - Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" + Style="{StaticResource OnlyProd_EgtCustomWindow}" WindowStyle="None" ResizeMode="NoResize" SizeToContent="Height" WindowStartupLocation="CenterOwner" diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml index 1f07a1aa..f4f4ef79 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml @@ -4,7 +4,7 @@ xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" - Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" + Style="{StaticResource OnlyProd_EgtCustomWindow}" WindowStyle="None" ResizeMode="NoResize" SizeToContent="Height" WindowStartupLocation="CenterOwner" diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index e9a42197..18def84b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -172,8 +172,6 @@ --> - - @@ -324,6 +322,7 @@ + - + + @@ -3066,7 +3029,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml index e305f896..c5fe1609 100644 --- a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/OnlyProdWarehouseWndV.xaml @@ -5,7 +5,7 @@ Width="{Binding WarehouseWnd_Width, Mode=TwoWay}" xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" - Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" + Style="{StaticResource OnlyProd_EgtCustomWindow}" WindowStyle="None" ResizeMode="NoResize" SizeToContent="Height" MinHeight="300" @@ -247,7 +247,7 @@ - - - - - - - - - - - - - --> - - + + + diff --git a/EgtBEAMWALL.Supervisor/MDIPage/OnlyProdMDIPageV.xaml.vb b/EgtBEAMWALL.Supervisor/MDIPage/OnlyProdMDIPageV.xaml.vb new file mode 100644 index 00000000..831879fb --- /dev/null +++ b/EgtBEAMWALL.Supervisor/MDIPage/OnlyProdMDIPageV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdMDIPageV + +End Class diff --git a/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelV.xaml b/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelV.xaml index cec04cd7..7f1acef8 100644 --- a/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelV.xaml +++ b/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelV.xaml @@ -1,6 +1,7 @@  + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Supervisor/MachineLogPage/OnlyProdMachineLogPageV.xaml.vb b/EgtBEAMWALL.Supervisor/MachineLogPage/OnlyProdMachineLogPageV.xaml.vb new file mode 100644 index 00000000..da2cef3d --- /dev/null +++ b/EgtBEAMWALL.Supervisor/MachineLogPage/OnlyProdMachineLogPageV.xaml.vb @@ -0,0 +1,3 @@ +Public Class OnlyProdMachineLogPageV + +End Class diff --git a/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb b/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb index 5fffc7b2..80ed952e 100644 --- a/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb +++ b/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb @@ -374,351 +374,4 @@ Public Class MachinePanelVM #End Region ' COMMANDS -End Class - - -'Imports System.Collections.ObjectModel -'Imports System.IO -'Imports EgtBEAMWALL.Core -'Imports EgtUILib -'Imports EgtWPFLib5 - -'Public Class MachinePanelVM -' Inherits VMBase - -'#Region "FIELDS & PROPERTIES" - -' ' Radice del direttorio delle macchine -' Private m_sMachinesRoot As String - -' ' Lista delle macchine disponibili -' Private m_MachineList As New ObservableCollection(Of Machine) -' Public Property MachineList As ObservableCollection(Of Machine) -' Get -' Return m_MachineList -' End Get -' Set(value As ObservableCollection(Of Machine)) -' m_MachineList = value -' End Set -' End Property -' ' Macchina correntemente selezionata e quindi attiva -' Private m_SelectedMachine As Machine = Nothing -' Public Property SelectedMachine As MyMachine -' Get -' Return m_SelectedMachine -' End Get -' Set(value As MyMachine) -' If value IsNot m_SelectedMachine Then -' 'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx()) -' 'EgtResetCurrMachGroup() -' ' se sono in modalità disegno -' m_SelectedMachine = value -' ' inizializzo la macchina selezionata come macchina corrente -' Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType -' SectionXMaterial.SetType(nMachType) -' InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType) -' End If -' End Set -' End Property - -' Private m_SetUp_Background As Brush = New BrushConverter().ConvertFrom("#FFDDDDDD") -' Public Property SetUp_Background As Brush -' Get -' Return m_SetUp_Background -' End Get -' Set(value As Brush) -' m_SetUp_Background = value -' NotifyPropertyChanged("SetUp_Background") -' End Set -' End Property - -' Private m_MachPanel_IsEnabled As Boolean = True -' Public Property MachPanel_IsEnabled As Boolean -' Get -' Return m_MachPanel_IsEnabled -' End Get -' Set(value As Boolean) -' m_MachPanel_IsEnabled = value -' NotifyPropertyChanged("MachPanel_IsEnabled") -' End Set -' End Property - -'#Region "Messages" - -' Public ReadOnly Property ToolDBMsg As String -' Get -' Return EgtMsg(MSG_MACHINEPAGEUC + 6) -' End Get -' End Property -' Public ReadOnly Property MachiningDbMsg As String -' Get -' Return EgtMsg(MSG_MACHINEPAGEUC + 7) -' End Get -' End Property -' Public ReadOnly Property SetUpMsg As String -' Get -' Return EgtMsg(MSG_ALARMSPAGEUC + 33) -' End Get -' End Property - -'#End Region ' Messages - -'#Region "ToolTip" - -' Public ReadOnly Property ToolDBToolTip As String -' Get -' Return "Tool DB" -' End Get -' End Property -' Public ReadOnly Property MachiningDbToolTip As String -' Get -' Return "Machining DB" -' End Get -' End Property -' Public ReadOnly Property SetUpToolTip As String -' Get -' Return "SetUp" -' End Get -' End Property - -'#End Region ' ToolTip - -' ' Definizione comandi -' Private m_cmdToolDb As ICommand -' Private m_cmdMachDb As ICommand -' Private m_cmdSetUp As ICommand -' Private m_cmdMachOptions As ICommand - -'#End Region 'FIELDS & PROPERTIES - -'#Region "CONSTRUCTOR" - -' Sub New() -' ' Creo riferimento a questa classe in Map -' Map.SetRefMachinePanelVM(Me) -' ' recupero cartella radice delle macchine -' m_sMachinesRoot = Map.refMainWindowVM.MainWindowM.sMachinesRoot -' ' Carica macchine da cartella delle macchine -' MyMachine.MachineListInit(m_sMachinesRoot, MachineList) -' End Sub - -'#End Region ' CONSTRUCTOR - -'#Region "METHODS" - -' Friend Sub LoadCurrentMachine() -' If MachineList.Count = 0 Then Return -' Dim CurrMachine As Machine = Nothing -' Dim CurrMachineName As String = String.Empty -' GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, String.Empty, CurrMachineName) -' Dim bFound As Boolean = False -' If Not String.IsNullOrEmpty(CurrMachineName) Then -' For Each Mach In MachineList -' If Mach.Name = CurrMachineName Then -' bFound = True -' CurrMachine = Mach -' Exit For -' End If -' Next -' End If -' If Not bFound And MachineList.Count > 0 Then -' CurrMachine = MachineList(0) -' End If -' If Not IsNothing(CurrMachine) Then -' If EgtSetCurrMachine(CurrMachine.Name) Then -' SelectedMachine = CurrMachine -' End If -' End If -' End Sub - -' Friend Sub SaveCurrentMachine() -' If IsNothing(m_SelectedMachine) Then Return -' WriteMainPrivateProfileString(S_MACH, K_CURRMACH, SelectedMachine.Name) -' End Sub - -' Friend Sub UpdateCurrentMachine() -' 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext) -' Dim sMachName As String = String.Empty -' If EgtGetCurrMachineName(sMachName) Then -' For Each Mach In MachineList -' If Mach.Name = sMachName Then -' SelectedMachine = Mach -' Exit For -' End If -' Next -' End If -' End Sub - -'#End Region - -'#Region "COMMANDS" - -'#Region "ToolDbCommand" - -' ''' -' ''' Returns a command that do Exec. -' ''' -' Public ReadOnly Property ToolDbCommand As ICommand -' Get -' If m_cmdToolDb Is Nothing Then -' m_cmdToolDb = New Command(AddressOf ToolDb) -' End If -' Return m_cmdToolDb -' End Get -' End Property - -' ''' -' ''' Execute the Exec. This method is invoked by the ExecCommand. -' ''' -' Public Sub ToolDb(ByVal param As Object) -' If Not VerifyMachinesDir(m_sMachinesRoot) Then Return -' ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa) -' If Not EgtTdbReload() Then -' EgtOutLog("Impossible reloading tool Db") -' MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) -' Return -' End If - -' Dim ToolDbWindowVM As New ToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam") -' Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM) -' If ToolDbWindowVM.MatType <> 0 Then -' ToolDbWindowV.Height = 640 -' ToolDbWindowV.Width = 1024 -' ToolDbWindowV.ShowDialog() -' Else -' Exit Sub -' End If - -' If Not SetUpUtility.IsValidToolHeadExitInSetUp() Then -' SetUp_Background = Brushes.Red -' Else -' SetUp_Background = OmagOFFICEDictionary.Button_Static_Background -' End If -' End Sub - -'#End Region ' ToolDbCommand - -'#Region "MachDbCommand" - -' ''' -' ''' Returns a command that do Exec. -' ''' -' Public ReadOnly Property MachDbCommand As ICommand -' Get -' If m_cmdMachDb Is Nothing Then -' m_cmdMachDb = New Command(AddressOf MachDb) -' End If -' Return m_cmdMachDb -' End Get -' End Property - -' ''' -' ''' Execute the Exec. This method is invoked by the ExecCommand. -' ''' -' Public Sub MachDb(ByVal param As Object) -' If Not VerifyMachinesDir(m_sMachinesRoot) Then Return -' ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa) -' If Not EgtMdbReload() Then -' EgtOutLog("Impossible reloading machining Db") -' MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) -' Return -' End If -' Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone") -' Dim MachDbWindowV As New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM) - -' If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then -' MachDbWindowV.Height = 768 -' MachDbWindowV.Width = 1024 -' MachDbWindowV.ShowDialog() -' Else -' Exit Sub -' End If - -' End Sub - -'#End Region ' MachDbCommand - -'#Region "SetUpCommand" - -' ''' -' ''' Returns a command that do Exec. -' ''' -' Public ReadOnly Property SetUpCommand As ICommand -' Get -' If m_cmdSetUp Is Nothing Then -' m_cmdSetUp = New Command(AddressOf SetUp) -' End If -' Return m_cmdSetUp -' End Get -' End Property - -' ''' -' ''' Execute the Exec. This method is invoked by the ExecCommand. -' ''' -' Public Sub SetUp(ByVal param As Object) -' ' verifico che il file di configurazione attrezzaggio (lua) della macchina esista -' If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then -' EgtOutLog("SetUp error: SetUp configuration file doesn't exist ") -' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) -' Return -' End If -' ' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato, -' ' e testa e uscita dell'utensile attrezzato -' EgtLuaExecFile(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) -' ' verifico che le teste riportate in configurazione esistano -' Dim Index As Integer = 1 -' Dim nErr As Integer = 0 -' While nErr = 0 -' Dim sHead As String = String.Empty -' nErr = 999 -' EgtLuaSetGlobIntVar("STU.INDEX", Index) -' EgtLuaCallFunction("STU.GetTcPosHeadGroupFromPos") -' ' Leggo variabili -' EgtLuaGetGlobStringVar("STU.HEAD", sHead) -' EgtLuaGetGlobIntVar("STU.ERR", nErr) -' If nErr = 0 Then -' If EgtGetHeadExitCount(sHead) = 0 Then -' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) -' Return -' End If -' End If -' Index += 1 -' End While -' ' Reset lua -' EgtLuaResetGlobVar("STU") - -' Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) -' SetUpWindow.Height = 614 -' SetUpWindow.Width = 1024 -' SetUpWindow.ShowDialog() - -' End Sub - -'#End Region ' SetUpCommand - -'#Region "MachOptionsCommand" - -' ''' -' ''' Returns a command that do Exec. -' ''' -' Public ReadOnly Property MachOptionsCommand As ICommand -' Get -' If m_cmdMachOptions Is Nothing Then -' m_cmdMachOptions = New Command(AddressOf MachOptions) -' End If -' Return m_cmdMachOptions -' End Get -' End Property - -' ''' -' ''' Execute the Exec. This method is invoked by the ExecCommand. -' ''' -' Public Sub MachOptions(ByVal param As Object) - -' End Sub - -'#End Region ' MachOptionsCommand - -'#End Region ' COMMANDS - -'End Class +End Class \ No newline at end of file diff --git a/EgtBEAMWALL.Supervisor/MainMenu/MainMenuVM.vb b/EgtBEAMWALL.Supervisor/MainMenu/MainMenuVM.vb index beaf79e3..cec1d390 100644 --- a/EgtBEAMWALL.Supervisor/MainMenu/MainMenuVM.vb +++ b/EgtBEAMWALL.Supervisor/MainMenu/MainMenuVM.vb @@ -108,14 +108,9 @@ Public Class MainMenuVM m_SelPage = Page Select Case m_SelPage Case Pages.SUPERVISOR - ' Map.refMachGroupPanelVM.SetMachGroupState(False) InitSUPERVISOR() - 'Map.refTopCommandBarVM.IsEnabled = False Case Pages.CONFIG InitCONFIG() - 'Map.refMachGroupPanelVM.SetMachGroupState(False) - 'Map.refCONFIGTabVM.InitCONFIGation() - 'Map.refTopCommandBarVM.IsEnabled = False Case Pages.INPUTS InitINPUTS() Case Pages.OUTPUTS @@ -228,49 +223,11 @@ Public Class MainMenuVM For Each col In Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed) Next - '' apro progetto proj - 'If Not IsNothing(Map.refProjManagerVM.CurrProj) Then - ' If Map.refProjManagerVM.CurrProj.bReloadProject Then - ' Map.refProjManagerVM.OpenProject(Map.refProjManagerVM.CurrProj) - ' ' aggiorno le colonne in base al tipo progetto - ' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then - ' Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) - ' Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) - ' Else - ' Map.refRawPartListVM.UpdateColumns(BWType.BEAM) - ' Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM) - ' End If - ' DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True) - ' ' aggiorno titolo - ' Map.refMainWindowVM.UpdateTitle() - ' Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames)) - ' Else - ' ' verifico se il prod di provenienza ha piu' proj - ' If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then - ' ' se si rigenero BTLStructure - ' Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId)) - ' End If - ' ' mostro tutti i pezzi - ' Map.refShowBeamPanelVM.ShowAll() - ' Map.refProjManagerVM.CurrProj.SetReloadProject(True) - ' End If - ' DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True) - 'Else - ' Map.refSceneHostVM.MainController.NewProject() - ' Map.refProjectVM.BTLStructureVM = Nothing - ' Map.refProjectVM.MachGroupPanelVM = Nothing - 'End If Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage)) Return True End Function Private Function ExitSUPERVISOR(bVerifyModification As Boolean) As Boolean - ' verifico se progetto modificato, e chiedo se salvare - 'If bVerifyModification Then - ' If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then - ' Return False - ' End If - 'End If Map.refProjectVM.SetBottomPanel_Visibility(False) Map.refProjectVM.SetLeftPanel_Visibility(True) Map.refProjectVM.SetPartManager_Visibility(False) diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb index 64f8f2bc..9a54f787 100644 --- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb +++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb @@ -1,5 +1,4 @@ Imports System.Threading -Imports System.Math Imports EgtUILib Imports EgtWPFLib5 Imports EgtBEAMWALL.Core @@ -197,8 +196,6 @@ Public Class MainWindowM #Region "METHODS" Private Sub InitializeEgtEnvironment() - '' Abilito drag and drop - 'Me.AllowDrop = True ' Impostazione path radice per i dati m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory If EgtUILib.GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowV.xaml b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowV.xaml index ab3201d1..31be0576 100644 --- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowV.xaml +++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowV.xaml @@ -30,7 +30,6 @@ - @@ -40,7 +39,6 @@ - diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb index 856384e9..2ae1b854 100644 --- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb @@ -83,40 +83,9 @@ Public Class MainWindowVM End Sub Friend Sub ContentRendered() - '' chiamata a caso su Db per inizializzarlo DbControllers.m_ProdController.FindByProdDbId(0) - ' Verifico che l'inizializzazione di tutte le parti del programma sia andata a buon fine - ' If Map.EndInit() Then - ' m_bInitStatus = True - ' altrimenti chiudo il programma - ' Else - ' m_bInitStatus = False - ' End If - ' Aggiorno visualizzazione unità di misura - ' Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH)) - ' Se istanza oltre la prima, chiedo cosa aprire - ' If Not m_MainWindowM.bFirstInstance Then - ' Map.refProjectManagerVM.Open() - ' ' altrimenti verifico se richiesto ultimo progetto - ' ElseIf GetMainPrivateProfileInt(S_GENERAL, K_AUTOLOADLASTPROJ, 0) = 1 Then - ' Dim sLastProjectPath As String = String.Empty - ' GetMainPrivateProfileString(S_GENERAL, K_LASTPROJ, String.Empty, sLastProjectPath) - ' If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then - ' Map.refProjectManagerVM.OpenProject(sLastProjectPath) - ' Else - ' Map.refProjectManagerVM.NewCmd() - ' End If - ' ' altrimenti nuovo progetto - ' Else - ' Map.refProjectManagerVM.NewCmd() - ' End If - ' apro in modalita' VIEW - ' Map.refMainMenuVM.SelPage = Pages.VIEW - ' imposto MainWindow per finestra di Loading LoadingWndHelper.SetMainWindow(Application.Current.MainWindow) - - ' leggo riga di comando Dim nCommandType As Integer = 0 Dim nPage As Pages = Nothing @@ -193,10 +162,6 @@ Public Class MainWindowVM ' sblocco interfaccia Map.refLeftPanelVM.bRestart = False End If - '' se misura attiva, la disattivo - 'If Map.refInstrumentPanelVM.GetDistIsChecked Then - ' Map.refInstrumentPanelVM.SetGetDistance_IsChecked(False) - 'End If ' pulisco output Map.refMyStatusBarVM.ClearOutputMessage() End If diff --git a/EgtBEAMWALL.Supervisor/OpenProjectFileDialog/OpenProjectFileDialogVM.vb b/EgtBEAMWALL.Supervisor/OpenProjectFileDialog/OpenProjectFileDialogVM.vb index 6a5ebb90..488417ae 100644 --- a/EgtBEAMWALL.Supervisor/OpenProjectFileDialog/OpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.Supervisor/OpenProjectFileDialog/OpenProjectFileDialogVM.vb @@ -1,8 +1,6 @@ Imports System.Collections.ObjectModel -Imports System.IO Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core.ConstBeam -Imports EgtUILib Public Class OpenProjectFileDialogVM Inherits Core.OpenProjectFileDialogVM diff --git a/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageV.xaml b/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageV.xaml index c38e8291..ca815606 100644 --- a/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageV.xaml +++ b/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageV.xaml @@ -1,9 +1,6 @@  + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor"> diff --git a/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageVM.vb b/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageVM.vb index 22a263ba..d7058aca 100644 --- a/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageVM.vb +++ b/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageVM.vb @@ -23,8 +23,6 @@ Public Class OutputsPageVM #Region "Constructor" Sub New() - '' imposto riferimento in Map - 'Map.SetRefOutputsPageVM(Me) m_OutputVariableListVM = New VariablesListVM(S_OUTPUTVARIABLES) End Sub diff --git a/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml b/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml index c0a00ca0..f8001be9 100644 --- a/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml +++ b/EgtBEAMWALL.Supervisor/Project/OnlyProdProjectV.xaml @@ -58,17 +58,17 @@ - + - + - + diff --git a/EgtBEAMWALL.Supervisor/Project/ProjectV.xaml b/EgtBEAMWALL.Supervisor/Project/ProjectV.xaml index b35069a5..7abea90f 100644 --- a/EgtBEAMWALL.Supervisor/Project/ProjectV.xaml +++ b/EgtBEAMWALL.Supervisor/Project/ProjectV.xaml @@ -35,11 +35,8 @@ Grid.Row="0"> - - @@ -80,12 +77,6 @@ Width="3" HorizontalAlignment="Center" VerticalAlignment="Stretch"/> - - - diff --git a/EgtBEAMWALL.Supervisor/Project/ProjectVM.vb b/EgtBEAMWALL.Supervisor/Project/ProjectVM.vb index 88fb26dd..21e4a6fa 100644 --- a/EgtBEAMWALL.Supervisor/Project/ProjectVM.vb +++ b/EgtBEAMWALL.Supervisor/Project/ProjectVM.vb @@ -1,5 +1,4 @@ Imports System.Collections.ObjectModel -Imports System.Threading Imports EgtBEAMWALL.Core Imports EgtWPFLib5 @@ -198,14 +197,11 @@ Public Class ProjectVM #End Region ' CONSTRUCTOR Friend Sub ManageIsEnabled(bIsEnabled As Boolean) - 'Map.refInstrumentPanelVM.SetInstrumentPanelIsEnabled(bIsEnabled) Map.refCALCPanelVM.SetCalcPanelIsEnabled(bIsEnabled) Map.refMainMenuVM.SetMainMenuIsEnabled(bIsEnabled) Map.refLeftPanelVM.SetLeftPanelIsEnabled(bIsEnabled) Map.refSupervisorManagerVM.SetSupervisorManagerIsEnabled(bIsEnabled) ' aggiungere gestione colonne editabili delle tabelle - - End Sub End Class diff --git a/EgtBEAMWALL.Supervisor/ProjectFileVM/ProdFileVM.vb b/EgtBEAMWALL.Supervisor/ProjectFileVM/ProdFileVM.vb index 0bb602a0..53c329af 100644 --- a/EgtBEAMWALL.Supervisor/ProjectFileVM/ProdFileVM.vb +++ b/EgtBEAMWALL.Supervisor/ProjectFileVM/ProdFileVM.vb @@ -1,6 +1,4 @@ -Imports System.IO -Imports EgtBEAMWALL.Core -Imports EgtUILib +Imports EgtBEAMWALL.Core Public Class ProdFileVM Inherits Core.ProdFileVM diff --git a/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb index 484420da..a076afe6 100644 --- a/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb @@ -25,7 +25,6 @@ Public Class MySceneHostVM Private m_vtTotMove As Vector3d Private m_dSnapDist As Double = 0 - Private bReducedCut As Boolean = False Private m_bMagnetic As Boolean @@ -160,7 +159,6 @@ Public Class MySceneHostVM MainScene.SetGridCursorPos(True) ' modo di visualizzazione Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING) - ' Map.refShowPanelVM.SetShowMode(DirectCast(nShowMode, SM)) ' visualizzazione avanzata dei triangoli costituenti le superfici Dim bShowTriaAdv As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0) EgtSetShowTriaAdv(bShowTriaAdv) @@ -318,11 +316,9 @@ Public Class MySceneHostVM End Sub Private Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String) - 'Map.refStatusBarVM.SetCurrPos(sCursorPos) End Sub Private Sub OnShowDistance(ByVal sender As Object, ByVal sDistance As String) - 'Map.refMyStatusBarVM.SetOutputMessage(sDistance) End Sub Private Sub OnChangedSnapPointType(ByVal sender As Object, ByVal nSpType As SP, ByVal bUser As Boolean) @@ -332,32 +328,6 @@ Public Class MySceneHostVM Else BtnColor = Brushes.Bisque End If - 'Select Case nSpType - ' Case SP.PT_SKETCH - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1102), BtnColor) 'Sketch Point - ' Case SP.PT_GRID - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1104), BtnColor) 'Grid Point - ' Case SP.PT_END - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1106), BtnColor) 'End Point - ' Case SP.PT_MID - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1108), BtnColor) 'Mid Point - ' Case SP.CENTER - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1110), BtnColor) 'Center - ' Case SP.CENTROID - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1112), BtnColor) 'Centroid - ' Case SP.PT_NEAR - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1114), BtnColor) 'Near Point - ' Case SP.PT_INTERS - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1116), BtnColor) 'Inters Point - ' Case SP.PT_TANGENT - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1118), BtnColor) 'Tang Point - ' Case SP.PT_PERPENDICULAR - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1120), BtnColor) 'Perp Point - ' Case SP.PT_MINDIST - ' Map.refStatusBarVM.SetSnapPointType(EgtMsg(1122), BtnColor) 'MinDist Point - ' Case Else - ' Map.refStatusBarVM.SetSnapPointType("---", BtnColor) - 'End Select End Sub #End Region ' EVENTS @@ -375,23 +345,6 @@ Public Class MySceneHostVM While nId <> GDB_ID.NULL ' Recupero l'identificativo del pezzo cui appartiene Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId)) - 'Dim WallMachGroup As WallMachGroup = DirectCast(Map.refMachGroupPanelVM.SelectedMachGroup, WallMachGroup) - 'Dim bPartInTable As Boolean = (EgtGetParent(nPartId) = WallMachGroup.nRawPartId) - 'If EgtIsPart(nPartId) OrElse EgtIsDuplo(nPartId) OrElse bPartInTable Then - ' Dim nStat As Integer = GDB_ST.ON_ - ' EgtGetStatus(nPartId, nStat) - ' ' Se già selezionato - ' If nStat = GDB_ST.SEL Then - ' ' Memorizzo Id da deselezionare - ' m_nIdToDesel = nPartId - ' Else - ' ' Memorizzo Id da selezionare - ' m_nIdToSel = nPartId - ' End If - ' ' Drag possibile - ' m_bDrag = True - ' Exit While - 'End If nId = EgtGetNextObjInSelWin() End While ' Dati per drag @@ -407,10 +360,6 @@ Public Class MySceneHostVM If Not m_bDrag Or m_bDragging Then Return ' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel If m_bDragToStart Then - 'If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And - ' Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then - ' Return - 'End If m_bDragToStart = False End If ' Determino cosa muovere @@ -481,7 +430,6 @@ Public Class MySceneHostVM Else EgtMove(nMoveId, -m_vtTotMove) End If - 'm_bFromParking = False ' altrimenti caso con verifica durante il movimento Else ' Basta reset alla fine @@ -498,10 +446,6 @@ Public Class MySceneHostVM m_bDrag = False m_nIdToSel = GDB_ID.NULL m_nIdToDesel = GDB_ID.NULL - '' Se nessun pezzo selezionato, reset flag posizione selezionati - 'If EgtGetSelectedObjCount() = 0 Then - ' m_nPartPos = PART_POS.NONE_TABLE - 'End If EgtDraw() End Sub diff --git a/EgtBEAMWALL.Supervisor/SceneHost/SceneHostV.xaml b/EgtBEAMWALL.Supervisor/SceneHost/SceneHostV.xaml index 7210e7b9..22e55479 100644 --- a/EgtBEAMWALL.Supervisor/SceneHost/SceneHostV.xaml +++ b/EgtBEAMWALL.Supervisor/SceneHost/SceneHostV.xaml @@ -1,7 +1,7 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:EgtUILib="clr-namespace:EgtUILib;assembly=EgtUILib"> diff --git a/EgtBEAMWALL.Supervisor/StatusBar/StatusBarV.xaml b/EgtBEAMWALL.Supervisor/StatusBar/StatusBarV.xaml index bee29cae..82663acc 100644 --- a/EgtBEAMWALL.Supervisor/StatusBar/StatusBarV.xaml +++ b/EgtBEAMWALL.Supervisor/StatusBar/StatusBarV.xaml @@ -1,7 +1,7 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + Background="{StaticResource Omag_LightGray}"> diff --git a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb index 564589a9..fe47a86d 100644 --- a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb +++ b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb @@ -234,14 +234,6 @@ Public Class SupervisorManagerVM 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") - 'Else - 'MessageBox.Show("Impossibile aprire gruppi di lavorazione del file!!") - 'Map.refSceneHostVM.MainController.NewProject() - 'Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL") - 'End If Else MessageBox.Show("Impossibile aprire il file!!") Map.refSceneHostVM.MainController.NewProject() @@ -331,8 +323,6 @@ Public Class SupervisorManagerVM ''' Execute the Open. This method is invoked by the OpenCommand. ''' Public Sub OpenMruFile(ByVal param As Object) - '' verifico se progetto modificato, e chiedo se salvare - 'If Not ProdFileVM.VerifyProjectModification(CurrProd) Then Return ' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo Dim PdId As Integer = 0 Dim arrStrPdId As String() = DirectCast(param, String).Split("|") diff --git a/EgtBEAMWALL.Supervisor/Utility/LogEvent.vb b/EgtBEAMWALL.Supervisor/Utility/LogEvent.vb index b8fa61c0..dbeb3975 100644 --- a/EgtBEAMWALL.Supervisor/Utility/LogEvent.vb +++ b/EgtBEAMWALL.Supervisor/Utility/LogEvent.vb @@ -178,10 +178,6 @@ Public Class LogEvent Sub New(MachLog As MachLog) Me.New(MachLog.AlarmDateTime, MachLog.ResultType, MachLog.VarAddress, MachLog.VarValue) - 'm_EventDateTime = MachLog.AlarmDateTime - 'm_EventType = MachLog.ResultType - 'm_SupervisorId = MachLog.VarAddress - 'm_Value = MachLog.VarValue End Sub Public Shared Function CreateMachLog(EventType As MachLogTypes, EventDateTime As DateTime, Value As String, SupervisorID As String) diff --git a/EgtBEAMWALL.Supervisor/Utility/MachParamIniFile.vb b/EgtBEAMWALL.Supervisor/Utility/MachParamIniFile.vb index 2f39bf61..853451d5 100644 --- a/EgtBEAMWALL.Supervisor/Utility/MachParamIniFile.vb +++ b/EgtBEAMWALL.Supervisor/Utility/MachParamIniFile.vb @@ -1,5 +1,4 @@ -Imports System.Collections.ObjectModel -Imports EgtUILib +Imports EgtUILib Imports EgtWPFLib5 Friend Module MachParamIniFile diff --git a/EgtBEAMWALL.Supervisor/Utility/Map.vb b/EgtBEAMWALL.Supervisor/Utility/Map.vb index d87d3dfa..bacbc036 100644 --- a/EgtBEAMWALL.Supervisor/Utility/Map.vb +++ b/EgtBEAMWALL.Supervisor/Utility/Map.vb @@ -3,8 +3,6 @@ Module Map Private m_refMainWindowVM As MainWindowVM - Private m_refMyStatusBarVM As MyStatusBarVM - 'Private m_refProjManagerVM As ProjManagerVM Private m_refSupervisorManagerVM As SupervisorManagerVM Private m_refProjectVM As ProjectVM Private m_refMainMenuVM As MainMenuVM @@ -13,17 +11,8 @@ Module Map Private m_refLeftPanelVM As LeftPanelVM Private m_refMachCommandMessagePanelVM As MachCommandMessagePanelVM Private m_refAxesPanelVM As AxesPanelVM - 'Private m_refBottomPanelVM As BottomPanelVM - 'Private m_refShowBeamPanelVM As ShowBeamPanelVM Private m_refConfigurationPageVM As ConfigurationPageVM Private m_refRawPartListVM As RawPartListVM - 'Private m_refWarehouseWndVM As WarehouseWndVM - 'Private m_refRawPartTabVM As RawPartTabVM - 'Private m_refNestingTabVM As NestingTabVM - 'Private m_refMachiningTabVM As MachiningTabVM - 'Private m_refSplitModeVM As SplitModeVM - 'Private m_refMoveRawModeVM As MoveRawModeVM - 'Private m_refSimulTabVM As SimulTabVM Private m_refMachManaging As MachManaging Private m_refCALCPanelVM As CALCPanelVM Private m_refSupervisorMachGroupPanelVM As SupervisorMachGroupPanelVM @@ -46,11 +35,6 @@ Module Map End Get End Property - 'Public ReadOnly Property refProjManagerVM As ProjManagerVM - ' Get - ' Return m_refProjManagerVM - ' End Get - 'End Property Public ReadOnly Property refSupervisorManagerVM As SupervisorManagerVM Get Return m_refSupervisorManagerVM @@ -123,18 +107,6 @@ Module Map End Get End Property - 'Public ReadOnly Property refBottomPanelVM As BottomPanelVM - ' Get - ' Return m_refBottomPanelVM - ' End Get - 'End Property - - 'Public ReadOnly Property refShowBeamPanelVM As ShowBeamPanelVM - ' Get - ' Return m_refShowBeamPanelVM - ' End Get - 'End Property - Public ReadOnly Property refConfigurationPageVM As ConfigurationPageVM Get Return m_refConfigurationPageVM @@ -147,54 +119,6 @@ Module Map End Get End Property - 'Public ReadOnly Property refWarehouseWndVM As WarehouseWndVM - ' Get - ' Return m_refWarehouseWndVM - ' End Get - 'End Property - - 'Public ReadOnly Property refOptionPanelVM As OptionPanelVM - ' Get - ' Return m_refOptionPanelVM - ' End Get - 'End Property - - 'Public ReadOnly Property refRawPartTabVM As RawPartTabVM - ' Get - ' Return m_refRawPartTabVM - ' End Get - 'End Property - - 'Public ReadOnly Property refNestingTabVM As NestingTabVM - ' Get - ' Return m_refNestingTabVM - ' End Get - 'End Property - - 'Public ReadOnly Property refMachiningTabVM As MachiningTabVM - ' Get - ' Return m_refMachiningTabVM - ' End Get - 'End Property - - 'Public ReadOnly Property refSplitModeVM As SplitModeVM - ' Get - ' Return m_refSplitModeVM - ' End Get - 'End Property - - 'Public ReadOnly Property refMoveRawModeVM As MoveRawModeVM - ' Get - ' Return m_refMoveRawModeVM - ' End Get - 'End Property - - 'Public ReadOnly Property refSimulTabVM As SimulTabVM - ' Get - ' Return m_refSimulTabVM - ' End Get - 'End Property - Public ReadOnly Property refFeatureInPartInRawPartListVM As FeatureInPartInRawPartListVM Get Return m_refFeatureInPartInRawPartListVM @@ -234,11 +158,6 @@ Module Map Return Not IsNothing(LibMap.refStatusBarVM) End Function - 'Friend Function SetRefProjManagerVM(ProjManagerVM As ProjManagerVM) As Boolean - ' m_refProjManagerVM = ProjManagerVM - ' Return Not IsNothing(m_refProjManagerVM) - 'End Function - Friend Function SetRefSupervisorManagerVM(SupervisorManagerVM As SupervisorManagerVM) As Boolean m_refSupervisorManagerVM = SupervisorManagerVM Return Not IsNothing(m_refSupervisorManagerVM) @@ -299,16 +218,6 @@ Module Map Return Not IsNothing(m_refSupervisorMachGroupPanelVM) End Function - 'Friend Function SetRefBottomPanelVM(BottomPanelVM As BottomPanelVM) As Boolean - ' m_refBottomPanelVM = BottomPanelVM - ' Return Not IsNothing(m_refBottomPanelVM) - 'End Function - - 'Friend Function SetRefShowBeamPanelVM(ShowBeamPanelVM As ShowBeamPanelVM) As Boolean - ' m_refShowBeamPanelVM = ShowBeamPanelVM - ' Return Not IsNothing(m_refShowBeamPanelVM) - 'End Function - Friend Function SetRefConfigurationPageVM(ConfigurationPageVM As ConfigurationPageVM) As Boolean m_refConfigurationPageVM = ConfigurationPageVM Return Not IsNothing(m_refConfigurationPageVM) @@ -319,46 +228,6 @@ Module Map Return Not IsNothing(m_refRawPartListVM) End Function - 'Friend Function SetRefWarehouseWndVM(WarehouseWndVM As WarehouseWndVM) As Boolean - ' m_refWarehouseWndVM = WarehouseWndVM - ' Return Not IsNothing(m_refWarehouseWndVM) - 'End Function - - 'Friend Function SetRefOptionPanelVM(OptionPanelVM As OptionPanelVM) As Boolean - ' m_refOptionPanelVM = OptionPanelVM - ' Return Not IsNothing(m_refOptionPanelVM) - 'End Function - - 'Friend Function SetRefRawPartTabVM(RawPartTabVM As RawPartTabVM) As Boolean - ' m_refRawPartTabVM = RawPartTabVM - ' Return Not IsNothing(m_refRawPartTabVM) - 'End Function - - 'Friend Function SetRefNestingTabVM(NestingTabVM As NestingTabVM) As Boolean - ' m_refNestingTabVM = NestingTabVM - ' Return Not IsNothing(m_refNestingTabVM) - 'End Function - - 'Friend Function SetRefMachiningTabVM(MachiningTabVM As MachiningTabVM) As Boolean - ' m_refMachiningTabVM = MachiningTabVM - ' Return Not IsNothing(m_refMachiningTabVM) - 'End Function - - 'Friend Function SetRefSplitModeVM(SplitModeVM As SplitModeVM) As Boolean - ' m_refSplitModeVM = SplitModeVM - ' Return Not IsNothing(m_refSplitModeVM) - 'End Function - - 'Friend Function SetRefMoveRawModeVM(MoveRawModeVM As MoveRawModeVM) As Boolean - ' m_refMoveRawModeVM = MoveRawModeVM - ' Return Not IsNothing(m_refMoveRawModeVM) - 'End Function - - 'Friend Function SetRefSimulTabVM(SimulTabVM As SimulTabVM) As Boolean - ' m_refSimulTabVM = SimulTabVM - ' Return Not IsNothing(m_refSimulTabVM) - 'End Function - Friend Function SetRefMachManaging(MachManaging As MachManaging) As Boolean m_refMachManaging = MachManaging Return Not IsNothing(m_refMachManaging) @@ -394,21 +263,13 @@ Module Map End Function Friend Function EndInit() As Boolean ' Verifico se tutti i pezzi necessari sono stati caricati - 'Return Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refProjectVM) AndAlso - ' Not IsNothing(LibMap.refStatusBarVM) AndAlso Not IsNothing(m_refProjectManagerVM) AndAlso - ' Not IsNothing(LibMap.refSceneHostVM) AndAlso Not IsNothing(LibMap.refShowPanelVM) AndAlso - ' Not IsNothing(m_refVeinMatchPanelVM) AndAlso - ' Not IsNothing(m_refOptionPanelVM) AndAlso Not IsNothing(m_refRawPartTabVM) AndAlso - ' Not IsNothing(m_refNestingTabVM) AndAlso Not IsNothing(m_refSimulTabVM) AndAlso - ' Not IsNothing(m_refMachiningTabVM) AndAlso - ' LibMap.EndInit() - 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 + Return Not IsNothing(m_refMainWindowVM) AndAlso + Not IsNothing(LibMap.refStatusBarVM) AndAlso Not IsNothing(m_refConfigurationPageVM) AndAlso Not IsNothing(m_refFeatureInPartInRawPartListVM) AndAlso Not IsNothing(m_refPartInRawPartListVM) AndAlso Not IsNothing(m_refAxesPanelVM) 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_refMDIPageVM) AndAlso 'Not IsNothing(m_refWarehouseWndVM) AndAlso Not IsNothing(m_refShowBeamPanelVM) AndAlso + Not IsNothing(m_refRawPartListVM) AndAlso Not IsNothing(m_refMDIPageVM) AndAlso Not IsNothing(m_refMachCommandMessagePanelVM) AndAlso Not IsNothing(m_refMachineLogPageVM) AndAlso LibMap.EndInit() End Function diff --git a/EgtBEAMWALL.Supervisor/VariablesList/VariablesListVM.vb b/EgtBEAMWALL.Supervisor/VariablesList/VariablesListVM.vb index c541e01d..18450673 100644 --- a/EgtBEAMWALL.Supervisor/VariablesList/VariablesListVM.vb +++ b/EgtBEAMWALL.Supervisor/VariablesList/VariablesListVM.vb @@ -1,5 +1,4 @@ Imports System.Collections.ObjectModel -Imports System.Windows.Threading Imports EgtWPFLib5 Imports EgtBEAMWALL.Core diff --git a/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerComm.vb b/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerComm.vb index 6cf59b03..f38db74b 100644 --- a/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerComm.vb +++ b/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerComm.vb @@ -1,13 +1,10 @@ -Imports EgtBEAMWALL.Core -Imports EgtBEAMWALL.DataLayer.DatabaseModels +Imports EgtBEAMWALL.DataLayer.DatabaseModels Public Class ViewerOptimizerComm Private m_bTickInExecution As Boolean = False Sub New() - ' imposto in Map - 'Map.SetRefMachManaging(Me) End Sub Friend Sub Timer_Tick() diff --git a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml index 803156c4..8b8297aa 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/AddFeatureWnd/AddFeatureWndV.xaml @@ -66,23 +66,6 @@ Height="300" Width="300" Margin="5,0,5,5"/> - diff --git a/EgtBEAMWALL.ViewerOptimizer/AddPartWnd/AddPartWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/AddPartWnd/AddPartWndV.xaml index e85ce166..d0a7ebe0 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddPartWnd/AddPartWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/AddPartWnd/AddPartWndV.xaml @@ -17,7 +17,6 @@ - - - - - - - - - - - - - diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb index 900e2d35..dfdaa80e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb @@ -1,5 +1,4 @@ Imports System.Collections.ObjectModel -Imports System.IO Imports EgtUILib Imports EgtWPFLib5 Imports EgtBEAMWALL.Core @@ -208,30 +207,6 @@ Public Class MyInstrumentPanelVM #Region "COMMANDS" - '#Region "Data" - - ' ''' - ' ''' Returns a command that do Open. - ' ''' - ' Public ReadOnly Property Data_Command As ICommand - ' Get - ' If m_cmdData Is Nothing Then - ' m_cmdData = New Command(AddressOf Data) - ' End If - ' Return m_cmdData - ' End Get - ' End Property - - ' ''' - ' ''' Execute the Open. This method is invoked by the OpenCommand. - ' ''' - ' Friend Sub Data() - ' Dim BTLDataWnd As New BTLDataWndV(Application.Current.MainWindow, New BTLDataWndVM()) - ' BTLDataWnd.ShowDialog() - ' End Sub - - '#End Region ' Data - #Region "ChangeParameter" ''' diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml index f9690fdf..30726016 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml @@ -67,18 +67,6 @@ - - - @@ -231,27 +211,6 @@ ToolTip="{Binding Path=DataContext.DONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/> - - - - - - @@ -264,20 +223,12 @@ - - diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/DuploQParameterListVM.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/DuploQParameterListVM.vb index 1cd7fcaa..f2bc3b1d 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/DuploQParameterListVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/DuploQParameterListVM.vb @@ -74,13 +74,10 @@ Public Class DuploQParameterListVM #Region "CONSTRUCTOR" Sub New() - ' Aggiungo riferimento a Map - ' Map.SetRefQParameterListVM(Me) ' carico le colonne della datagrid GetPrivateProfileColumns(S_DUPLOPARAMETERLIST_Q, QParameterListColumns) ' recupero riferimento a colonna Value e Custom m_colQParam_Value = QParameterListColumns.FirstOrDefault(Function(x) x.Name = COL_VALUE) - 'm_colQParam_Custom = QParameterListColumns.FirstOrDefault(Function(x) x.Name = COL_CUSTOM) End Sub #End Region ' CONSTRUCTOR diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml index fc4d9344..01a32011 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml @@ -3,12 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"> - + - - @@ -69,7 +53,6 @@ - @@ -88,16 +71,6 @@ FontWeight="Bold" FontSize="12" Margin="0,-6,0,-2"/> - - @@ -105,9 +78,6 @@ - @@ -116,9 +86,6 @@ - @@ -128,11 +95,4 @@ - diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml index 7f4d6368..83d58d07 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml @@ -24,14 +24,6 @@ BindingColumns="{Binding FeatureColumns}" Style="{StaticResource DataGrid_CustomHighLight}"> - - @@ -58,7 +50,6 @@ - @@ -77,16 +68,6 @@ FontWeight="Bold" FontSize="12" Margin="0,-6,0,-2"/> - - diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml index 219f83cf..b848d544 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml @@ -119,18 +119,8 @@ - - - - diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb index 041c5ebd..1e35516d 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb @@ -133,8 +133,6 @@ Public Class PartInRawPartListVM Sub New() ' aggiungo riferimento a map Map.SetRefPartInRawPartListVM(Me) - ' carico le colonne della datagrid - 'GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns) End Sub #End Region ' CONSTRUCTOR diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartParametersV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartParametersV.xaml index d29d8218..d68c0376 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartParametersV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartParametersV.xaml @@ -84,12 +84,6 @@ RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartParametersV}}}" Grid.Column="1" Style="{StaticResource PartParam_TextBox}"/> - diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QBTLParamVM.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QBTLParamVM.vb index cca89476..1cab8ce1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QBTLParamVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QBTLParamVM.vb @@ -1,7 +1,4 @@ -Imports System.Collections.ObjectModel -Imports EgtBEAMWALL.Core -Imports EgtUILib -Imports EgtWPFLib5 +Imports EgtBEAMWALL.Core Public Class QBTLParamVM Inherits BTLParamVM diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParamListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParamListV.xaml index 08ed2c53..c5e9b918 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParamListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParamListV.xaml @@ -74,85 +74,6 @@ - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml index cda6729d..51ddf384 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml @@ -116,17 +116,7 @@ - - - - diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/RawPartListVM.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/RawPartListVM.vb index f4c6c929..dc07b11a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/RawPartListVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/RawPartListVM.vb @@ -109,8 +109,6 @@ Public Class RawPartListVM Sub New() ' Aggiungo riferimento a Map Map.SetRefRawPartListVM(Me) - ' carico le colonne della datagrid - 'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns) End Sub #End Region ' CONSTRUCTOR diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb index e2d7f0d8..d836e2c1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb @@ -1,9 +1,6 @@ Imports System.Collections.ObjectModel -Imports System.ComponentModel -Imports System.IO Imports EgtBEAMWALL.Core Imports EgtUILib -Imports EgtWPFLib5 Public Class MyMachGroupPanelVM Inherits Core.MyMachGroupPanelVM @@ -51,10 +48,6 @@ Public Class MyMachGroupPanelVM If Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then Map.refShowBeamPanelVM.bShowAll = False - 'If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then - ' EgtBeamShowFacesName(False) - ' EgtBeamShowLoadingSide(False, False) - 'End If m_SelectedMachGroup = value If Not IsNothing(value) Then OnPreSetCurrMachGroup() @@ -129,45 +122,6 @@ Public Class MyMachGroupPanelVM NotifyPropertyChanged(NameOf(MachGroupVMList)) End Sub - 'Protected Overrides Sub CreateMachGroupVMList() - ' Dim all As New List(Of MachGroupVM) - ' For Each MachGroupM In m_MachGroupPanelM.GetMachGroups() - ' If DirectCast(MachGroupM, MyMachGroupM).nMachineType = MachineType.BEAM Then - ' all.Add(New BeamMachGroupVM(MachGroupM)) - ' Else - ' all.Add(New WallMachGroupVM(MachGroupM)) - ' End If - ' Next - - ' For Each MachGroupvM As MachGroupVM In all - ' AddHandler MachGroupvM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged - ' Next - - ' MachGroupVMList = New ObservableCollection(Of MachGroupVM)(all) - ' AddHandler MachGroupVMList.CollectionChanged, AddressOf OnMachGroupVMListChanged - 'End Sub - - 'Public Overrides Function InitMachGroupList(Optional bUseDefaults As Boolean = False) As Boolean - ' ' Svuoto precedente lista di MachGroup - ' MachGroupVMList.Clear() - ' ' aggiorno copie - ' MyMachGroupPanelM.UpdateDuplo() - ' ' verifico se esistono già gruppi di lavorazione o se devo creare il primo - ' Dim bOk As Boolean = False - ' Dim nId = EgtGetFirstMachGroup() - ' If nId <> GDB_ID.NULL Then - ' bOk = EgtSetCurrMachGroup(nId) - ' End If - ' If Not bOk Then Return True - ' ' carico lista dei gruppi di lavorazione - ' m_MachGroupPanelM.MachGroupMList = MyMachGroupPanelM.LoadMyMachGroups(Map.refMachinePanelVM.MachineList.ToList()) - ' ' elimino copie da cancellare - ' MyMachGroupPanelM.DeleteDuplo() - ' If bOk Then SelectedMachGroup = MachGroupVMList(0) - ' EgtZoom(ZM.ALL) - ' Return True - 'End Function - Public Function RefreshMachGroupList() As Boolean ' carico lista dei gruppi di lavorazione For Each MachGroup As MyMachGroupM In MyMachGroupPanelM.UpdateFromNestingMyMachGroups(Map.refMachinePanelVM.MachineList.ToList()) diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb index cfa24103..d12864c1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb @@ -414,19 +414,7 @@ Public Class MyMachGroupVM PartList.Add(BTLPartVM) Next - 'Dim sPartArray(m_PartVMList.Count - 1) As String - '' ciclo per salvare in un array di stringhe i valori di POSX e POSY prima di resettare - 'Dim ind As Integer = 0 - 'For Each Part In m_PartVMList - ' sPartArray(ind) = Part.sPOSX & "," & Part.sPOSY & "," & 0 & "," & 0 - ' ind += 1 - 'Next EgtResetCurrMachGroup() - '' recupero lista dei pezzi BTL originali - 'Dim PartList As New List(Of BTLPartVM) - 'For Each Part In m_PartVMList - ' PartList.Add(BTLPartVM.RetrieveBTLPartFromPart(Part.nPartId)) - 'Next ' verifico che nessun pezzo da copiare abbia raggiunto il numero massimo If Not VerifyPartCount(PartList, Qty) Then Return Nothing ' creo nuovi gruppi di lavorazione diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb index d989c0b1..fee3d93f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb @@ -280,7 +280,6 @@ Public Class PartVM End Set End Property - ' Definizione comandi Private m_cmdBackRotation As ICommand Private m_cmdForwardRotation As ICommand @@ -447,17 +446,13 @@ Public Class PartVM ' se parete, valuto angolo di posizionamento Select Case CurrentMachine.NestingCorner Case MCH_CR.TL - 'vtDeltaBox = New Vector3d(b3Box.Min.x - b3Part.Min.x, b3Box.Max.y - b3Part.Max.y, 0) dTempPosY = dTempPosY - dW + dL Case MCH_CR.BL - 'vtDeltaBox = b3Box.Min - b3Part.Min ' non cambio posizioni Case MCH_CR.TR - 'vtDeltaBox = b3Box.Max - b3Part.Max dTempPosX = dTempPosX - dL + dW dTempPosY = dTempPosY - dW + dL Case MCH_CR.BR - 'vtDeltaBox = New Vector3d(b3Box.Max.x - b3Part.Max.x, b3Box.Min.y - b3Part.Min.y, 0) dTempPosX = dTempPosX - dL + dW End Select Case Else @@ -653,24 +648,6 @@ Public Class PartVM EgtGetInfo(nPartId, BTL_PRT_STOREY, sSTOREY) EgtGetInfo(nPartId, BTL_PRT_MATERIAL, sMATERIAL) If nType = BWType.BEAM Then - '' leggo PosX - 'Dim sInfo As String = "" - 'Dim Index = 1 - 'Dim sSplitInfo() As String = Nothing - 'Dim bFound As Boolean = False - 'While EgtGetInfo(m_ParentMachGroup.Id, MGR_RPT_PART & Index, sInfo) - ' If Not String.IsNullOrWhiteSpace(sInfo) Then - ' sSplitInfo = sInfo.Split(","c) - ' If sSplitInfo(0) = nPartId Then - ' bFound = True - ' Exit While - ' End If - ' End If - ' Index += 1 - 'End While - 'If bFound Then - ' StringToDoubleAdv(sSplitInfo(1), dPOSX) - 'End If Else ' leggo PosX, PosY, Rot e Flip EgtGetInfo(nPartId, MGR_PRT_POSX, dPOSX) @@ -687,12 +664,6 @@ Public Class PartVM PartM.RefreshBTLFeatures() FeatureVMList.Clear() CreateBTLFeatureVMList() - - 'aggiorno le sue feature - ' PartM.LoadBTLFeatures(PartM, PartM.nPartId) - 'For Each Feature In FeatureVMList - ' Feature.RefreshFeature() - 'Next End Sub #End Region ' Part diff --git a/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelVM.vb index 91a7648b..11a8631a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelVM.vb @@ -1,5 +1,4 @@ -Imports System.Collections.ObjectModel -Imports System.IO +Imports System.IO Imports EgtBEAMWALL.Core Imports EgtUILib Imports EgtWPFLib5 @@ -190,7 +189,6 @@ Public Class MachinePanelVM End Sub Friend Sub UpdateCurrentMachine() - 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext) Dim sMachName As String = String.Empty If EgtGetCurrMachineName(sMachName) Then For Each Mach In MachineList @@ -258,7 +256,6 @@ Public Class MachinePanelVM Else Exit Sub End If - End Sub Public Overrides Sub MachDb(ByVal param As Object) @@ -279,7 +276,6 @@ Public Class MachinePanelVM Else Exit Sub End If - End Sub Public Overrides Sub SetUp(ByVal param As Object) @@ -318,7 +314,6 @@ Public Class MachinePanelVM SetUpWindow.Height = 614 SetUpWindow.Width = 1024 SetUpWindow.ShowDialog() - End Sub #End Region diff --git a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndV.xaml index ff5068e9..dee06994 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndV.xaml @@ -56,11 +56,6 @@ Grid.Column="1" Width="200"/> - diff --git a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndVM.vb index 59abfd78..03a0fe99 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MacroFeatureWnd/MacroFeatureWndVM.vb @@ -17,10 +17,6 @@ Public Class MacroFeatureWndVM Friend Const MACRO_DIRX As String = "%xx,xy,xz%" Friend Const MACRO_DIRY As String = "%yx,yy,yz%" Friend Const MACRO_DIRZ As String = "%zx,zy,zz%" - 'Friend Const MACRO_L As String = "%L%" - 'Friend Const MACRO_W As String = "%W%" - 'Friend Const MACRO_H As String = "%H%" - 'Friend Const MACRO_ID As String = "%Id%" Friend Const MACRO_VPAR As String = "%vPar%" Friend Const MACRO_SPAR As String = "%sPar%" Friend Const MACRO_VPARQ As String = "%vParQ%" diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb index 23d2c2e6..fb9dff44 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb @@ -123,18 +123,11 @@ Public Class MainMenuVM m_SelPage = Page Select Case m_SelPage Case Pages.VIEW - ' Map.refMachGroupPanelVM.SetMachGroupState(False) InitVIEW() - 'Map.refTopCommandBarVM.IsEnabled = False Case Pages.MACHINING - ' Map.refMachGroupPanelVM.SetMachGroupState(True) InitMACHINING() - 'Map.refTopCommandBarVM.IsEnabled = True Case Pages.CONFIG InitCONFIG() - 'Map.refMachGroupPanelVM.SetMachGroupState(False) - 'Map.refCONFIGTabVM.InitCONFIGation() - 'Map.refTopCommandBarVM.IsEnabled = False Case Pages.ONLYPRODPAGE InitONLYPRODPAGE() End Select @@ -415,7 +408,6 @@ Public Class MainMenuVM End If ProjectManagerVM.CurrProd.SetReloadProject(True) End If - 'DbControllers.m_ProdController.ResetController() ' se Warehouse di tipo Medium e piu' di un progetto collegato Dim nDefault As Integer = 2 If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM AndAlso ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then @@ -462,7 +454,6 @@ Public Class MainMenuVM Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refPartInRawPartManagerVM.MovePart_Visibility)) Map.refProjectVM.SetBottomPanel_Visibility(False) Map.refProjectVM.SetLeftPanel_Visibility(True) - 'Map.refLeftPanelVM.UpdateView() If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.UpdateView() If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.UpdateView() Map.refProjectVM.SetFeatureManager_Visibility(False) @@ -607,8 +598,6 @@ Public Class MainMenuVM Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType) If Not IsNothing(Map.refTopPanelVM) Then Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) - 'Else - ' Map.refProjectVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) End If Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) ' resetto modifica parametri Q default @@ -644,7 +633,6 @@ Public Class MainMenuVM End If ProjectManagerVM.CurrProd.SetReloadProject(True) End If - 'DbControllers.m_ProdController.ResetController() ' se Warehouse di tipo Medium e piu' di un progetto collegato Dim nDefault As Integer = 2 If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM AndAlso ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then @@ -678,7 +666,6 @@ Public Class MainMenuVM Map.refProjectVM.BTLStructureVM = Nothing Map.refProjectVM.MachGroupPanelVM = Nothing End If - Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage)) Map.refMainMenuVM.NotifyPropertyChanged(NameOf(Map.refMainMenuVM.SendFeedbackIsEnabled)) Map.refInstrumentPanelVM.NotifyPropertyChanged(NameOf(Map.refInstrumentPanelVM.Statistic_Visibility)) @@ -797,23 +784,6 @@ Public Class MainMenuVM ' Recupero numero chiave Dim sKey As String = String.Empty EgtGetKeyInfo(sKey) - '' Recupero file del progetto corrente - 'Dim sCurrProject As String = String.Empty - 'EgtGetCurrFilePath(sCurrProject) - '' se nome file vuoto, chiedo se si vuole salvare - 'If String.IsNullOrWhiteSpace(sCurrProject) Then - ' If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then - ' Map.refSceneHostVM.SaveProject() - ' End If - ' EgtGetCurrFilePath(sCurrProject) - ' ' se modificato, chiedo se si vuole salvare - 'Else - ' If EgtGetModified() Then - ' If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then - ' Map.refSceneHostVM.SaveProject() - ' End If - ' End If - 'End If ' Esporto il progetto Dim ProjFileMList As List(Of ProjFileM) If (SelPage = Pages.MACHINING OrElse SelPage = Pages.ONLYPRODPAGE) And Not IsNothing(ProjectManagerVM.CurrProd) Then @@ -904,10 +874,6 @@ Public Class MainMenuVM #End Region ' SendFeedbackCommand -#Region "TEST" - -#End Region ' TEST - #End Region ' COMMANDS End Class \ No newline at end of file diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml index 1b1ea52a..0a67365c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml @@ -31,11 +31,9 @@ - - diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb index f1f07dda..c931e6fe 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb @@ -147,7 +147,7 @@ Public Class MainWindowVM Friend Sub ContentRendered() DbControllers.Init() - '' chiamata a caso su Db per inizializzarlo + ' chiamata a caso su Db per inizializzarlo DbControllers.m_ProjController.FindByProjDbId(0) ' Verifico che l'inizializzazione di tutte le parti del programma sia andata a buon fine If Map.EndInit() Then @@ -156,8 +156,6 @@ Public Class MainWindowVM Else m_bInitStatus = False End If - ' Aggiorno visualizzazione unità di misura - 'Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH)) ' imposto MainWindow per finestra di Loading LoadingWndHelper.SetMainWindow(Application.Current.MainWindow) ' leggo riga di comando @@ -383,11 +381,6 @@ Public Class MainWindowVM MessageBox.Show(EgtMsg(62102), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning) 'Restore running! Impossible closing the software until finish the restore process! Return End If - 'If Map.refOptionPanelVM.SelItem = OptionPanelVM.Tabs.SIMUL Then - ' Map.refSimulTabVM.ResetSimulation() - 'End If - ' Imposto contesto principale - 'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx()) ' Gestisco eventuale file corrente modificato Dim bOk As Boolean = True Select Case Map.refMainMenuVM.SelPage diff --git a/EgtBEAMWALL.ViewerOptimizer/MultiCopyRawPartWnd/MultiCopyRawPartWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/MultiCopyRawPartWnd/MultiCopyRawPartWndVM.vb index 2bd627b7..c4bb9fd6 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MultiCopyRawPartWnd/MultiCopyRawPartWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MultiCopyRawPartWnd/MultiCopyRawPartWndVM.vb @@ -1,8 +1,5 @@ -Imports System.Collections.ObjectModel -Imports System.IO -Imports EgtUILib +Imports EgtUILib Imports EgtWPFLib5 -Imports EgtBEAMWALL.Core Public Class MultiCopyRawPartWndVM Inherits VMBase diff --git a/EgtBEAMWALL.ViewerOptimizer/NestingRunningWnd/NestingRunningWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/NestingRunningWnd/NestingRunningWndVM.vb index d28daddf..fb3411b0 100644 --- a/EgtBEAMWALL.ViewerOptimizer/NestingRunningWnd/NestingRunningWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/NestingRunningWnd/NestingRunningWndVM.vb @@ -420,7 +420,6 @@ Public Class NestingRunningWndVM EgtSetInfo(nCurrMachGroup, "RAWOUTLINEID", nOutlineId) Else ' recupero dati da box - EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELLEN, b3Box.DimX()) EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELWIDTH, b3Box.DimY()) End If @@ -621,7 +620,6 @@ Public Class NestingRunningWndVM End If Exit While End If - ' passo al prossimo RawPart nRawPartId = EgtGetNext(nRawPartId) End While @@ -726,7 +724,6 @@ Public Class NestingRunningWndVM QParam.NotifyPropertyChanged(NameOf(QParam.bCustom)) Next End If - 'Map.refProjectVM.MachGroupPanelVM.SelLastMachGroup() EgtDraw() ' riabilito interfaccia Map.refProjectVM.SetCalcRunning(False) @@ -764,8 +761,6 @@ Public Class NestingRunningWndVM 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 diff --git a/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb b/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb index 69deef2d..a48df99c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb @@ -1,9 +1,7 @@ -Imports System.Collections.ObjectModel -Imports System.IO +Imports System.IO Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core.ConstBeam Imports EgtUILib -Imports EgtWPFLib5 Public Class NewOpenProjectFileDialogVM Inherits Core.NewOpenProjectFileDialogVM @@ -107,10 +105,6 @@ Public Class NewOpenProjectFileDialogVM If Project.sMachine = ProjectManagerVM.CurrProj.sMachine AndAlso Project.nType = ProjectManagerVM.CurrProj.nType Then If File.Exists(sPath) Then - ' m_ProjectList.Add(New ProdItem(New ProdFileVM(Project))) - 'Else - ' DbControllers.m_ProdController.DeleteProd(Project.nProdId) - ' EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000")) End If End If Next @@ -127,9 +121,6 @@ Public Class NewOpenProjectFileDialogVM ProjList.Add(New ProjFileVM(ProjFileM)) Next m_ProjectList.Add(New ProdItem(New ProdFileVM(Project), ProjList)) - 'Else - ' DbControllers.m_ProdController.DeleteProd(Project.nProdId) - ' EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000")) End If Next End If @@ -179,21 +170,9 @@ Public Class NewOpenProjectFileDialogVM ' cancello progetto If Not IsNothing(SelProject.ProdFileVM) Then DbControllers.m_ProdController.DeleteProd(SelProject.ProdFileVM.nProdId, True) - '' cancello cartella del Prod - 'Try - ' Directory.Delete(SelProject.ProdFileVM.sProdDirPath, True) - 'Catch ex As Exception - ' EgtOutLog("Error in deleting directory " & SelProject.ProdFileVM.sProdDirPath) - 'End Try End If For Each Project In SelProject.ProjFileList DbControllers.m_ProjController.DeleteProj(Project.nProjId, True) - '' cancello cartella del Proj - 'Try - ' Directory.Delete(Project.sProjDirPath, True) - 'Catch ex As Exception - ' EgtOutLog("Error in deleting directory " & Project.sProjDirPath) - 'End Try Next ' aggiorno lista progetti RefreshProjectList() diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb index 059a8a0c..aa33beae 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb @@ -57,14 +57,6 @@ Public Class OnlyProdManagerVM End Set End Property - ' indice progetto in caricamento - 'Private m_nLoadingProjId As Integer = 0 - 'Public ReadOnly Property nLoadingProjId As Integer - ' Get - ' Return m_nLoadingProjId - ' End Get - 'End Property - Friend m_MruFiles As New MruList Public ReadOnly Property MruFileNames As ObservableCollection(Of String) Get @@ -342,7 +334,6 @@ Public Class OnlyProdManagerVM If EgtGetCurrFilePath(sProjPath) AndAlso Not String.IsNullOrEmpty(sProjPath) Then Try File.Copy(sProjPath, sProdPath) - 'Map.refSceneHostVM.MainController.OpenProject(sProdPath) bOk = True Catch ex As Exception EgtOutLog("Impossibile copiare il file") @@ -689,7 +680,6 @@ Public Class OnlyProdManagerVM ' se nuovo progetto If CurrProd.bIsNew Then ' resetto stato new - ' DbControllers.m_ProdController.Reset(CurrProd.nProjId) CurrProd.bIsNew = False End If Map.refMainWindowVM.UpdateTitle() @@ -1280,7 +1270,6 @@ Public Class OnlyProdManagerVM Dim SameAsseBaseProjId As Integer EgtGetInfo(FindAsseBaseId, BTL_PRT_PROJ, SameAsseBaseProjId) ' se l'ho trovato esco dal While (FindAsseBaseId è l'id dell'AsseBase in cui vogliamo rilocare i sottonodi) - 'If SameAsseBaseProjId = ProjectManagerVM.CurrProj.nProjId Then Exit While If SameAsseBaseProjId = CurrProd.nProdId Then Exit While FindAsseBaseId = EgtGetNextName(FindAsseBaseId, ASSEBASE) End While @@ -1661,10 +1650,7 @@ Public Class OnlyProdManagerVM CurrProd = Nothing ' carico Machgroup che non verrebbero altrimenti importati Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList())) - 'If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then ' inizializzo nuovo progetto PROD - 'Dim nProdId As Integer = 0 - 'Dim sProdDir As String = "" InitNewProd(NewProjIdList(0), nProdId, sProdDir) ' setto il PType del Prod DbControllers.m_ProdController.UpdatePType(nProdId, nType) @@ -1730,15 +1716,12 @@ Public Class OnlyProdManagerVM DbControllers.m_ProdController.LockByProdId(nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) End If DbControllers.m_ProdController.ResetController() - 'End If ' imposto progetto corrente If NewProjIdList.Count > 0 Then SetCurrProj(NewProjIdList(0)) SetCurrProd(nProdId) OpenProject(CurrProd) ' Da controllare End If - '' ripristino eventuale CurrProd precedente - 'CurrProd = TempCurrProd WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, Path.GetDirectoryName(ImportDlg.FileName)) LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT) End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelV.xaml index fe93138c..fdb08751 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelV.xaml @@ -39,7 +39,6 @@ Command="{Binding Optimize_Command}" IsEnabled="{Binding Optimize_IsEnabled}" Visibility="{Binding Optimize_Visibility}"> - - - diff --git a/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerVM.vb index bc68a9c0..d825645c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerVM.vb @@ -14,7 +14,6 @@ Public Class PartManagerVM Private m_Lock_Visibility As Visibility Public ReadOnly Property Lock_Visibility As Visibility Get - 'Return Visibility.Collapsed Return If(Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = Core.ConstBeam.BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO), Visibility.Visible, Visibility.Collapsed) diff --git a/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PDFViewerVM.vb b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PDFViewerVM.vb index 21a4ef86..a7ab7007 100644 --- a/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PDFViewerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PDFViewerVM.vb @@ -32,19 +32,6 @@ Public Class PDFViewerVM End Get End Property - 'Public Shared ReadOnly PdfPathProperty As DependencyProperty = DependencyProperty.Register("PdfPath", - ' GetType(String), - ' GetType(PDFViewerVM)) - - 'Private Shared Sub OnPdfPathChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs) - ' 'Dim pdfDrawer As PdfViewer = CType(d, PdfViewer) - - ' If Not String.IsNullOrEmpty(PdfPath) Then - ' Dim path = System.IO.Path.GetFullPath(PdfPath) - ' StorageFile.GetFileFromPathAsync(path).AsTask().ContinueWith(Function(t) PdfDocument.LoadFromFileAsync(t.Result).AsTask()).Unwrap().ContinueWith(Function(t2) PdfToImages(pdfDrawer, t2.Result), TaskScheduler.FromCurrentSynchronizationContext()) - ' End If - 'End Sub - #End Region ' Field & Properties Sub New() diff --git a/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml index 4d2aa823..65f5c604 100644 --- a/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/PdfViewer/PdfViewer.xaml @@ -1,6 +1,7 @@  + @@ -9,7 +10,7 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml index 48b0db7a..0596619f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml @@ -32,11 +32,6 @@ Style="{StaticResource ToolBar_Button}"> - - - - - - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb index 02665161..aedc7208 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb @@ -3,7 +3,6 @@ Imports System.IO Imports System.Windows.Threading Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core.ConstBeam -Imports EgtBEAMWALL.DataLayer.DatabaseModels Imports EgtUILib Imports EgtWPFLib5 @@ -313,16 +312,6 @@ Public Class ProdManagerVM If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then Map.refProjectVM.SetOptimizePanel_Visibility(True) Map.refTopPanelVM.UpdateQParameterVisibility() - 'SectionXMaterial.SetType(Map.refProjectVM.BTLStructureVM.nPROJTYPE) - '' aggiorno le colonne in base al tipo progetto - 'Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) - 'Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) - 'm_CurrProd = TempCurrProd - 'DbControllers.m_ProdController.LockByProdId(m_CurrProd.nProdId, True) - '' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel - 'Map.refCALCPanelVM.LoadMachineList() - '' seleziono primo gruppo - 'Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup() End If End If ' imposto flag secondo tipo di progetto (travi o pareti) @@ -435,7 +424,6 @@ Public Class ProdManagerVM ' se nuovo progetto If CurrProd.bIsNew Then ' resetto stato new - ' DbControllers.m_ProdController.Reset(CurrProd.nProjId) CurrProd.bIsNew = False End If Map.refMainWindowVM.UpdateTitle() @@ -589,7 +577,6 @@ Public Class ProdManagerVM ' apro progetto proj Map.refProjManagerVM.SetCurrProj(nProjId) ' ricarico progetto se il prod e' nullo (quindi e' stato cancellato) - 'ProjectManagerVM.CurrProj.SetReloadProject(IsNothing(CurrProd) OrElse VerifyResult = MessageBoxResult.No) ProjectManagerVM.CurrProj.SetReloadProject(IsNothing(CurrProd) OrElse VerifyResult = MessageBoxResult.No OrElse VerifyResult = MessageBoxResult.None) ' vado in pagina proj Map.refMainMenuVM.SetSelPage(Pages.VIEW, False) @@ -636,7 +623,6 @@ Public Class ProdManagerVM End Try End If ' mando richiesta di apertura progetto in supervisore - 'Dim x = DbControllers.m_StatusMapController.GetProd DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInSupervisorRequest, "") End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml index d317c5e4..33006d12 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml @@ -36,26 +36,11 @@ Style="{StaticResource ToolBar_Button}"> - - - @@ -465,7 +451,6 @@ Public Class ProjManagerVM End If LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROJ, 3, EgtMsg(63000), EgtMsg(63001), 50) ' Project opening ' Loading project geometries ' imposto ProjId di caricamento - 'm_nLoadingProjId = TempCurrProj.nProjId ProjectManagerVM.nLoadingProjId = TempCurrProj.nProjId ' se esiste prod prendo quello, altrimenti proj Dim sFilePath As String = "" @@ -1333,8 +1318,8 @@ Public Class ProjManagerVM ' apro finestra di salvataggio progetto Dim ExportDlg As New Microsoft.Win32.SaveFileDialog() With {.DefaultExt = ".ngexp", - .Filter = "ProjectExport (*.ngexp)|*.ngexp", - .FileName = CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - ProjectExport"} + .Filter = "ProjectExport (*.ngexp)|*.ngexp", + .FileName = CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - ProjectExport"} If IsNothing(sExportFileName) Then If ExportDlg.ShowDialog() <> True Then Return Nothing End If @@ -1367,17 +1352,6 @@ Public Class ProjManagerVM ' ci scrivo nome macchina e tipo progetto EgtSetInfo(nImpExpPartId, EXP_MACHINE, CurrProj.sMachine) EgtSetInfo(nImpExpPartId, BTL_GEN_PROJTYPE, CurrProj.nType) - '' se c'e' un prod collegato - 'If ProjectManagerVM.CurrProj.nProdId > 0 Then - ' ' scrivo quali sono i proj e prod in questo file - ' Dim Prod As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(ProjectManagerVM.CurrProj.nProdId) - ' EgtSetInfo(Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId, EXP_PROD, ProjectManagerVM.CurrProj.nProdId) - ' For ProjIndex = 0 To Prod.nProjIdList.Count - 1 - ' EgtSetInfo(Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId, EXP_PROJ & ProjIndex + 1, Prod.nProjIdList(ProjIndex)) - ' Next - 'Else - ' EgtSetInfo(Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId, EXP_PROJ & 1, ProjectManagerVM.CurrProj.nProjId) - 'End If LoadingWndHelper.UpdateLoadingWnd(ActiveIds.EXPORTPROJECT, 2, EgtMsg(63017), 30, 100) ' Exporting... ' salvo info inserite Map.refSceneHostVM.SaveProject() @@ -1638,7 +1612,6 @@ Public Class ProjManagerVM If EgtGetCurrFilePath(sProjPath) AndAlso Not String.IsNullOrEmpty(sProjPath) Then Try File.Copy(sProjPath, sProdPath) - 'Map.refSceneHostVM.MainController.OpenProject(sProdPath) bOk = True Catch ex As Exception EgtOutLog("Impossibile copiare il file") @@ -1684,33 +1657,6 @@ Public Class ProjManagerVM ProjectManagerVM.CurrProd = CurrProd WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, Path.GetDirectoryName(ImportDlg.FileName)) LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT) - ' imposto progetto corrente - 'If NewProjIdList.Count > 0 Then SetCurrProj(NewProjIdList(0)) - ' costruisco BTLStructure del proj - 'Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(NewProjIdList(0))) - ' mostro tutti i pezzi - 'Map.refShowBeamPanelVM.ShowAll() - 'EgtZoom(ZM.ALL, True) - ' aggiungo il file in apertura alla lista degli MRU - 'If Not IsNothing(CurrProj.ProjFileM) AndAlso Not IsNothing(CurrProj.sProjPath) Then Map.refProjManagerVM.m_MruFiles.Add(CurrProj.sProjPath) - ' imposto macchina del progetto - 'Map.refMachinePanelVM.SelectedMachine = Machine - ' aggiorno le colonne in base al tipo progetto - 'Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) - 'Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) - 'DbControllers.m_ProjController.LockByProjId(ProjectManagerVM.CurrProj.nProjId, True) - ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel - 'Map.refCALCPanelVM.LoadMachineList() - 'SectionXMaterial.SetType(nType) - 'ManageView.UpdateBWType(nType) - 'Map.refPartManagerVM.LockVisibilityUpdate() - ' imposto flag secondo tipo di progetto (travi o pareti) - 'Dim sBTLFlag As String = If(nType = Core.ConstBeam.BWType.BEAM, K_BTLFLAG, K_WALLBTLFLAG) - 'Dim nFlag As Integer = GetMainPrivateProfileInt(S_IMPORT, sBTLFlag, EIB_FL.TS3_POS + EIB_FL.SORT + EIB_FL.USEUATTR) - 'EgtBeamSetFlag(nFlag) - 'Map.refProjectVM.SetOptimizePanel_Visibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL) - ' aggiorno titolo - 'Map.refMainWindowVM.UpdateTitle() End Sub #End Region ' ImportProject @@ -1758,73 +1704,10 @@ Public Class ProjManagerVM Dim nProdId As Integer = ProjectManagerVM.CurrProj.nProdId If nProdId > 0 Then ProjectManagerVM.SetCurrProd(nProdId) - 'ProjectManagerVM.CurrProd.SetReloadProject(Not bSaved) ProjectManagerVM.CurrProd.SetReloadProject(bSaved) Else 'creo nuova ottimizzazione da progetto corrente NewProdFromProj() - - '' chiedo se aggiungere ad ottimizzazione già presente o creare nuova - 'Select Case MessageBox.Show("Aggiungere ad ottimizzazione già esistente?", "", MessageBoxButton.YesNoCancel, MessageBoxImage.Information) - ' Case MessageBoxResult.No - ' 'creo nuova ottimizzazione da progetto corrente - ' NewProdFromProj() - ' Case MessageBoxResult.Yes - ' ' chiedo in quale ottimizzazione aggiungere il progetto corrente - ' Dim OpenProjectFileDialogVM As New OpenProjectFileDialogVM - ' Dim ChooseProdFileDialog As New OpenProjectFileDialogV(Application.Current.MainWindow, OpenProjectFileDialogVM) - ' Dim DialogResult As Boolean? = ChooseProdFileDialog.EgtShowDialog(ProjectType.PROD, True) - ' If IsNothing(DialogResult) OrElse Not DialogResult Then Return - ' ' se prod selezionato - ' If Not IsNothing(OpenProjectFileDialogVM.SelProject.nProdId) AndAlso OpenProjectFileDialogVM.SelProject.nProdId > 0 Then - ' Dim nCurrCtx As Integer = EgtGetCurrentContext() - ' Dim nTempCtx As Integer = EgtInitContext() - ' Dim bOk As Boolean = nTempCtx <> 0 - ' If bOk Then - ' ' inizializzo gestore lavorazioni - ' bOk = EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir) - ' ' apro il prod - ' bOk = bOk AndAlso EgtOpenFile(OpenProjectFileDialogVM.SelProject.sProdPath) - ' '''' calcolo BBox globale - ' '''Dim b3Parts As BBox3d - ' '''Dim nProdPartId As Integer = EgtGetFirstPart() - ' '''While nProdPartId <> GDB_ID.NULL - ' ''' Dim b3Part As New BBox3d - ' ''' EgtGetBBoxGlob(nProdPartId, 1, b3Part) - ' ''' b3Parts.Add(b3Part) - ' ''' nProdPartId = EgtGetNextPart(nProdPartId) - ' '''End While - ' ' inserisco proj nel prod selezionato - ' bOk = bOk AndAlso EgtInsertFile(ProjectManagerVM.CurrProj.sProjPath) - ' ' DA METTERE IN MERGE BTL, NON QUI!!! - ' '''' deseleziono tutto - ' '''EgtDeselectAll() - ' '''' ciclo sui pezzi - ' '''Dim nPartId As Integer = EgtGetFirstPart() - ' '''While nPartId <> GDB_ID.NULL - ' ''' ' se arrivano dal nuovo progetto - ' ''' Dim nCurrProjId As Integer - ' ''' EgtGetInfo(nPartId, PROJ, nCurrProjId) - ' ''' If nCurrProjId = ProjectManagerVM.CurrProj.nProjId Then - ' ''' ' sposto i pezzi per non averli sovrapposti - ' ''' EgtMove(nCurrProjId, New Vector3d(0, b3Parts.DimY() + 500, 0)) - ' ''' End If - ' '''End While - ' bOk = bOk AndAlso EgtSaveFile(OpenProjectFileDialogVM.SelProject.sProdPath, NGE.CMPTEXT) - ' ' torno sul contesto corrente - ' EgtSetCurrentContext(nCurrCtx) - ' EgtDeleteContext(nTempCtx) - ' End If - ' If bOk Then - ' ' riporto aggiunta proj a prod su Db - ' DbControllers.m_ProdController.AddProj(OpenProjectFileDialogVM.SelProject.nProdId, ProjectManagerVM.CurrProj.nProjId) - ' ' imposto currprod - ' Map.refProdManagerVM.SetCurrProd(OpenProjectFileDialogVM.SelProject.nProdId) - ' End If - ' End If - ' Case MessageBoxResult.Cancel - ' Return - 'End Select End If ' Ricavo il tipo di Warehouse settato nell'INI Dim nDefault As Integer = 2 diff --git a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml index 42c0fd9b..aac8c03f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml @@ -2,7 +2,6 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" - xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" DataContext="{StaticResource ProjectVM}"> @@ -18,10 +17,6 @@ - - @@ -60,18 +55,7 @@ Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/> - - - - BWType.BEAM) - 'Else - ' Map.refProjectVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) End If Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then @@ -597,7 +591,6 @@ Public Class MySceneHostVM CurrProd = Map.refOnlyProdManagerVM.TempCurrProd ProjectManagerVM.CurrProd = CurrProd End If - 'DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) DbControllers.m_ProdController.LockByProdId(CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) ' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel Map.refCALCPanelVM.LoadMachineList() @@ -917,10 +910,6 @@ Public Class MySceneHostVM If Not m_bDrag Or m_bDragging Then Return ' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel If m_bDragToStart Then - 'If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And - ' Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then - ' Return - 'End If m_bDragToStart = False End If ' Determino cosa muovere @@ -1023,7 +1012,6 @@ Public Class MySceneHostVM Else EgtMove(nMoveId, -m_vtTotMove) End If - 'm_bFromParking = False ' altrimenti caso con verifica durante il movimento Else ' Basta reset alla fine @@ -1057,10 +1045,6 @@ Public Class MySceneHostVM m_bDrag = False m_nIdToSel = GDB_ID.NULL m_nIdToDesel = GDB_ID.NULL - '' Se nessun pezzo selezionato, reset flag posizione selezionati - 'If EgtGetSelectedObjCount() = 0 Then - ' m_nPartPos = PART_POS.NONE_TABLE - 'End If EgtDraw() End Sub @@ -1155,9 +1139,6 @@ Public Class MySceneHostVM Map.refProjectVM.BTLStructureVM.SelBTLParts.Remove(Map.refProjectVM.BTLStructureVM.SelBTLParts(RemoveIndex)) End If Next - 'While Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 1 - ' If Map. - 'End While Else Map.refProjectVM.BTLStructureVM.SelBTLParts.Clear() Map.refProjectVM.BTLStructureVM.SelBTLParts.Add(CurrPart) @@ -1177,21 +1158,6 @@ Public Class MySceneHostVM End If Map.refProjectVM.BTLStructureVM.SelBTLParts.Add(CurrPart) End If - - - ' ' Se pezzo da selezionare non è già selezionato - ' If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) OrElse - ' Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt = 0 OrElse - ' Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId <> m_nIdToSel Then - ' ' Eseguo la selezione - ' For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList - ' If BTLPart.nPartId = m_nIdToSel Then - ' BTLPart.SetIsSelected(True) - ' ElseIf BTLPart.IsSelected Then - ' BTLPart.SetIsSelected(False) - ' End If - ' Next - ' End If End If ' Reset m_bDrag = False diff --git a/EgtBEAMWALL.ViewerOptimizer/SetUp/SetUpV.xaml b/EgtBEAMWALL.ViewerOptimizer/SetUp/SetUpV.xaml index 2d18eb7c..3c5c108b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SetUp/SetUpV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/SetUp/SetUpV.xaml @@ -14,12 +14,6 @@ ItemsSource="{Binding ToolsList}" Margin="5"> - - @@ -2317,9 +2305,6 @@ - - @@ -2371,6 +2356,13 @@ + + @@ -2382,7 +2374,6 @@ - @@ -3164,7 +3155,21 @@ - + + + + + + + From 49ed63e2d4b5a722ce1cd0761d8826438e45df6d Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 19 Jun 2024 17:29:16 +0200 Subject: [PATCH 108/126] -sistemato codice pdfeditor --- .../MultiCopyRawPartWndV.xaml | 2 - .../Statistics/PDFEditorV.xaml | 1 - .../Statistics/PDFEditorVM.vb | 43 ++++++++--------- .../Statistics/PDFHelper.vb | 46 +++---------------- 4 files changed, 25 insertions(+), 67 deletions(-) diff --git a/EgtBEAMWALL.ViewerOptimizer/MultiCopyRawPartWnd/MultiCopyRawPartWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/MultiCopyRawPartWnd/MultiCopyRawPartWndV.xaml index 828537ec..e6a37af8 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MultiCopyRawPartWnd/MultiCopyRawPartWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MultiCopyRawPartWnd/MultiCopyRawPartWndV.xaml @@ -2,8 +2,6 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" - xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" - xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStyle="None" ResizeMode="NoResize" SizeToContent="WidthAndHeight" diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml index 9bbb6ac3..1c3b74a1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml @@ -131,7 +131,6 @@ Grid.Column="1" Grid.RowSpan="2" Style="{StaticResource GroupBox_PDFPreview}"> - diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb index 6ac3e578..dcc8446a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorVM.vb @@ -25,26 +25,26 @@ Public Class PDFEditorVM ' PDF visualizzato come preview nella sezione PDF Editor Private m_WebAddress As String - Public Property WebAddress As String + Public ReadOnly Property WebAddress As String Get Return m_WebAddress End Get - Set(value As String) - m_WebAddress = value - NotifyPropertyChanged(NameOf(WebAddress)) - End Set End Property + Friend Sub SetWebAddress(value As String) + m_WebAddress = value + NotifyPropertyChanged(NameOf(WebAddress)) + End Sub Private m_PdfViewer_Visibility As Visibility - Public Property PdfViewer_Visibility As Visibility + Public ReadOnly Property PdfViewer_Visibility As Visibility Get Return m_PdfViewer_Visibility End Get - Set(value As Visibility) - m_PdfViewer_Visibility = value - NotifyPropertyChanged(NameOf(PdfViewer_Visibility)) - End Set End Property + Friend Sub SetPdfViewer_Visibility(value As Visibility) + m_PdfViewer_Visibility = value + NotifyPropertyChanged(NameOf(PdfViewer_Visibility)) + End Sub ' Definizione comandi Private m_cmdCreatePDFPreviewVis As ICommand @@ -62,8 +62,8 @@ Public Class PDFEditorVM m_ExpanderList.Add(New ExpanderPDF(ListTypes.RAWPART)) ' RawPart List m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART_TOT)) ' Part Totals m_ExpanderList.Add(New ExpanderPDF(ListTypes.PART)) ' Part List - m_WebAddress = "" ' Pagina vuota - m_PdfViewer_Visibility = Visibility.Hidden + SetWebAddress("") ' Pagina vuota + SetPdfViewer_Visibility(Visibility.Hidden) Map.SetRefPDFEditorVM(Me) End Sub @@ -86,11 +86,9 @@ Public Class PDFEditorVM ''' Funzione per la visualizzazione della preview del PDF della sezione visualizzatore ''' Public Sub CreatePreviewVis() - m_PdfViewer_Visibility = Visibility.Visible + SetPdfViewer_Visibility(Visibility.Visible) Configuration.CreatePrintPDF(PDFPage.VIEW, True) - WebAddress = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf" - NotifyPropertyChanged(NameOf(WebAddress)) - NotifyPropertyChanged(NameOf(PdfViewer_Visibility)) + SetWebAddress(Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf") End Sub #End Region ' CreatePreviewVis @@ -110,11 +108,9 @@ Public Class PDFEditorVM ''' Funzione per la visualizzazione della preview del PDF della sezione ottimizzatore ''' Public Sub CreatePreviewOtt() - m_PdfViewer_Visibility = Visibility.Visible + SetPdfViewer_Visibility(Visibility.Visible) Configuration.CreatePrintPDF(PDFPage.MACHING, True) - WebAddress = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf" - NotifyPropertyChanged(NameOf(WebAddress)) - NotifyPropertyChanged(NameOf(PdfViewer_Visibility)) + SetWebAddress(Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf") End Sub #End Region ' CreatePreviewOt @@ -136,15 +132,12 @@ Public Class PDFEditorVM Public Sub ClosePreview() Try File.Delete(Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf") - 'File.Delete(Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics - Optimizer.pdf") Catch ex As Exception EgtOutLog("Errore! Cancellazione dei file pdf fallita") End Try - m_PdfViewer_Visibility = Visibility.Hidden - WebAddress = "" - NotifyPropertyChanged(NameOf(WebAddress)) - NotifyPropertyChanged(NameOf(PdfViewer_Visibility)) + SetPdfViewer_Visibility(Visibility.Hidden) + SetWebAddress("") End Sub #End Region ' CreatePreviewVis diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb index 00b71f80..717394a7 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb @@ -7,7 +7,6 @@ Imports EgtUILib Imports System.Collections.ObjectModel Imports PdfSharp.Drawing Imports MigraDoc.DocumentObjectModel.Shapes -Imports System.Windows.Forms.VisualStyles.VisualStyleElement.Header Imports System.IO Module PDFHelper @@ -27,8 +26,8 @@ Module PDFHelper Public Function CreateStatReport(ActivePage As Pages, bPreview As Boolean) As Document ' creo nuovo documento MigraDoc - Dim document As Document = New Document() - Dim Project As ProjectFileVM = ProjectManagerVM.CurrProd + Dim document As New Document() + Dim Project As ProjectFileVM If ActivePage = Pages.VIEW OrElse (ActivePage = Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.bVisOtt_Selected = False) Then Project = ProjectManagerVM.CurrProj @@ -146,7 +145,7 @@ Module PDFHelper End Sub Private Sub DefineItem(document As Document, nListType As ListTypes, bPreview As Boolean, sMachGroupList As ExpanderTable, sName As EgtDataGridColumn, sW As EgtDataGridColumn, sH As EgtDataGridColumn, sL As EgtDataGridColumn, sMaterial As EgtDataGridColumn, sUsage As EgtDataGridColumn, sWaste As EgtDataGridColumn, sUTime As EgtDataGridColumn, sQty As EgtDataGridColumn, sPDN As EgtDataGridColumn, sDesc As EgtDataGridColumn, sCNT As EgtDataGridColumn, sAdded As EgtDataGridColumn, sDone As EgtDataGridColumn, sUVolume As EgtDataGridColumn, sTVolume As EgtDataGridColumn, sTTime As EgtDataGridColumn, sINProd As EgtDataGridColumn, section As Section) - Dim countItemList As Integer = 0 + Dim countItemList As Integer Select Case nListType Case ListTypes.PART section.AddParagraph(EgtMsg(61733), "Heading2") @@ -155,7 +154,7 @@ Module PDFHelper Case ListTypes.RAWPART section.AddParagraph(EgtMsg(61732), "Heading2") End Select - Dim table As Table = New Table() + Dim table As New Table() table.Borders.Width = 0.75 ' ciclo sulle colonne per creare la tabella e riempirne i campi ' -2 -> creo colonne @@ -538,13 +537,13 @@ Module PDFHelper End Sub Private Sub CreateRawPartPage(document As Document, sMachGroupList As ExpanderTable, sPDN As EgtDataGridColumn, sW As EgtDataGridColumn, sH As EgtDataGridColumn, sL As EgtDataGridColumn, sDesc As EgtDataGridColumn, sMaterial As EgtDataGridColumn, RawPart As MyMachGroupVM, bPreview As Boolean) - Dim countPartVMList As Integer = 0 Dim section As Section = document.AddSection() ' cambio orientamento a verticale Dim pgSetup As PageSetup = document.DefaultPageSetup.Clone() pgSetup.Orientation = Orientation.Landscape section.PageSetup = pgSetup Dim PartVMList As IEnumerable(Of Object) + Dim countPartVMList As Integer If IsNothing(RawPart) Then PartVMList = New List(Of Object) CreateRawPartImage(section, sMachGroupList, 44143, 1, bPreview) @@ -574,8 +573,7 @@ Module PDFHelper ' recupero elemento della riga PartVM = PartVMList(PartIndex) End If - Dim Columnlist As ObservableCollection(Of EgtDataGridColumn) = Nothing - Columnlist = sMachGroupList.RawPartColumns + Dim Columnlist As ObservableCollection(Of EgtDataGridColumn) = sMachGroupList.RawPartColumns For ColumnIndex = 0 To Columnlist.Count - 1 Select Case Columnlist(ColumnIndex).Name Case COL_PDN @@ -667,7 +665,7 @@ Module PDFHelper Private Sub CreateRawPartImage(section As Section, sMachGroupList As ExpanderTable, RawPartId As Integer, RawPartName As String, bPreview As Boolean) ' creo immagine - Dim sImagePath As String = String.Empty + Dim sImagePath As String If File.Exists(Map.refMainWindowVM.MainWindowM.sTempDir & "\Image" & RawPartId & ".png") Then sImagePath = Map.refMainWindowVM.MainWindowM.sTempDir & "\Image" & RawPartId & ".png" Else @@ -703,11 +701,6 @@ Module PDFHelper Image.RelativeHorizontal = RelativeHorizontal.Margin End Sub - Private Sub DrawImage(gfx As XGraphics, sImagePath As String) - Dim image As XImage = XImage.FromFile(sImagePath) - Dim x As Double = (250 - image.PixelWidth * 72 / image.HorizontalResolution) / 2 - gfx.DrawImage(image, x, 0) - End Sub ''' ''' Defines the styles used in the document. ''' @@ -810,31 +803,6 @@ Module PDFHelper hyperlink.AddPageRefField("Charts") End Sub - ''' - ''' Defines page setup, headers, and footers. - ''' - Private Sub DefineContentSection(ByVal document As Document) - Dim section As Section = document.AddSection() - section.PageSetup.OddAndEvenPagesHeaderFooter = True - section.PageSetup.StartingNumber = 1 - - Dim header As HeaderFooter = section.Headers.Primary - header.AddParagraph(vbTab & "Odd Page Header") - - header = section.Headers.EvenPage - header.AddParagraph("Even Page Header") - - ' Create a paragraph with centered page number. See definition of style "Footer". - Dim paragraph As Paragraph = New Paragraph() - paragraph.AddTab() - paragraph.AddPageField() - ' Add paragraph to footer for odd pages. - section.Footers.Primary.Add(paragraph) - ' Add clone of paragraph to footer for odd pages. Cloning is necessary because an object must - ' not belong to more than one other object. If you forget cloning an exception is thrown. - section.Footers.EvenPage.Add(paragraph.Clone()) - End Sub - #Region "Paragraphs" Public Sub DefineParagraphs(ByVal document As Document) From 6d13c9478baecb6e7aa784b97f010b96ed05374a Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 25 Jun 2024 09:26:04 +0200 Subject: [PATCH 109/126] -aggiunto controllo in configurationpage scelta tra ts3data e ebwdata --- EgtBEAMWALL.Core/Constants/ConstIni.vb | 3 ++- EgtBEAMWALL.Core/Constants/ConstMachIni.vb | 1 + EgtBEAMWALL.Core/Utility/Configuration.vb | 9 +++++++++ .../ConfigurationPage/ConfigurationPageVM.vb | 20 +++++++++++++++---- .../InputPwdWnd/OnlyProdInputPwdWndV.xaml | 1 + .../InputPwdWnd/OnlyProdInputPwdWndV.xaml.vb | 1 + .../MainWindow/MainWindowM.vb | 11 ++++++++++ .../Statistics/OnlyProdPDFEditorV.xaml | 2 +- .../Statistics/PDFEditorV.xaml | 2 +- .../Utility/Dictionary.xaml | 2 +- 10 files changed, 44 insertions(+), 8 deletions(-) diff --git a/EgtBEAMWALL.Core/Constants/ConstIni.vb b/EgtBEAMWALL.Core/Constants/ConstIni.vb index 7294468b..57e82081 100644 --- a/EgtBEAMWALL.Core/Constants/ConstIni.vb +++ b/EgtBEAMWALL.Core/Constants/ConstIni.vb @@ -111,7 +111,8 @@ Public Module ConstIni Public Const K_ONLYPROD As String = "OnlyProd" Public Const K_MODIFYSETUP As String = "ModifySetup" - + Public Const K_MACHCONFIG As String = "MachConfig" + Public Const S_SPECIAL As String = "Special" Public Const K_SPECIALENABLE As String = "SpecialEnable" diff --git a/EgtBEAMWALL.Core/Constants/ConstMachIni.vb b/EgtBEAMWALL.Core/Constants/ConstMachIni.vb index 75989e72..680d034b 100644 --- a/EgtBEAMWALL.Core/Constants/ConstMachIni.vb +++ b/EgtBEAMWALL.Core/Constants/ConstMachIni.vb @@ -24,5 +24,6 @@ Public Const K_FLOW As String = "Flow" Public Const TS3DATA_FILE As String = "Ts3Data.lua" + Public Const EBWDATA_FILE As String = "EbwData.lua" End Module diff --git a/EgtBEAMWALL.Core/Utility/Configuration.vb b/EgtBEAMWALL.Core/Utility/Configuration.vb index 78012045..76296c0f 100644 --- a/EgtBEAMWALL.Core/Utility/Configuration.vb +++ b/EgtBEAMWALL.Core/Utility/Configuration.vb @@ -20,5 +20,14 @@ m_bModifySetup = value End Sub + Private m_bMachConfig As Boolean + Public ReadOnly Property bMachConfig As Boolean + Get + Return m_bMachConfig + End Get + End Property + Public Sub SetMachConfig(value As Boolean) + m_bMachConfig = value + End Sub End Module diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb index 93700577..cc656c19 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb @@ -934,14 +934,24 @@ Public Class ConfigurationPageVM Next NewTs3DataFileContent.Add("local Machine = {" & sMachineStr.TrimEnd(",") & "}") NewTs3DataFileContent.Add("return Machine") - Dim FilePath As String = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & TS3DATA_FILE + Dim FilePath As String + If Map.refMainWindowVM.MainWindowM.bMachConfig Then + FilePath = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & EBWDATA_FILE + Else + FilePath = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & TS3DATA_FILE + End If Dim sBakFilePath As String = Path.ChangeExtension(FilePath, ".bak") If File.Exists(sBakFilePath) Then File.Delete(sBakFilePath) If File.Exists(FilePath) Then File.Move(FilePath, sBakFilePath) File.WriteAllLines(FilePath, NewTs3DataFileContent, Text.Encoding.UTF8) ' se macchina di tipo BOTH copio il file appena scritto nella cartella Wall nella cartella Beam If CurrentMachine.nType = MachineType.BOTH Then - Dim DestinationFilePath As String = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & TS3DATA_FILE + Dim DestinationFilePath As String + If Map.refMainWindowVM.MainWindowM.bMachConfig Then + DestinationFilePath = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & EBWDATA_FILE + Else + DestinationFilePath = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & TS3DATA_FILE + End If sBakFilePath = Path.ChangeExtension(DestinationFilePath, ".bak") If File.Exists(sBakFilePath) Then File.Delete(sBakFilePath) File.Move(DestinationFilePath, Path.ChangeExtension(DestinationFilePath, ".bak")) @@ -1019,10 +1029,10 @@ Public Class ConfigurationPageVM ' funzione che verifica l'inserimento della password quando si edita un parametro Macchina Friend Function VerifyConfigPagePassword() As Boolean - Dim InputPwdWnd As Object = Nothing + Dim InputPwdWnd As Object ' Display message, title, and default value. Dim InputPwdWndVM As New InputPwdWndVM() - If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then + If bOnlyProd Then InputPwdWnd = New OnlyProdInputPwdWndV(Application.Current.MainWindow, InputPwdWndVM) Else InputPwdWnd = New InputPwdWndV(Application.Current.MainWindow, InputPwdWndVM) @@ -1213,6 +1223,8 @@ Public Class MachParam Case Else UpdateParamValue(0, value) End Select + + If Map.refConfigurationPageVM.bModifyMachParam Then Map.refConfigurationPageVM.VerifyConfigPageModification() End Set End Property Public Property dValue As Double diff --git a/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml index 5dca6a77..2d1f0607 100644 --- a/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/InputPwdWnd/OnlyProdInputPwdWndV.xaml @@ -22,6 +22,7 @@ Text="{Binding PasswordMsg}" Style="{StaticResource PasswordMsg_TextBlock}"/> - + diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml index 1c3b74a1..47f587de 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFEditorV.xaml @@ -131,7 +131,7 @@ Grid.Column="1" Grid.RowSpan="2" Style="{StaticResource GroupBox_PDFPreview}"> - + diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index 20926564..5f7a0c73 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -2447,7 +2447,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/OnlyProdMainWindowV.xaml b/EgtBEAMWALL.ViewerOptimizer/MainWindow/OnlyProdMainWindowV.xaml index 25625f41..7b425412 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/OnlyProdMainWindowV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/OnlyProdMainWindowV.xaml @@ -12,7 +12,7 @@ ShowInTaskbar="True" CloseCommand="{Binding CloseApplicationCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"> - + diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index af3b8a60..c6f32c4d 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -2540,6 +2540,22 @@ + + @@ -2573,6 +2589,27 @@ + + From ca00c134e9a453c867f73e0e5821b132dbab881f Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Mon, 5 Aug 2024 09:57:41 +0200 Subject: [PATCH 113/126] -aggiunto controllo su finestre personalizzate se nuova o vecchia finestra --- EgtBEAMWALL.Core/BTLModel/BTLFeatureM.vb | 7 +- .../EgtDataGrid/EgtDataGrid.xaml.vb | 14 +- EgtBEAMWALL.Core/Lib/NewMachGroupPanelVM.vb | 15 +- .../CALCPanel/CALCPanelVM.vb | 7 +- EgtBEAMWALL.Supervisor/Comms/NUMAxiumComm.vb | 14 +- .../Comms/NUMAxiumPcToolkitComm.vb | 14 +- .../Comms/NUMFlexiumComm.vb | 14 +- EgtBEAMWALL.Supervisor/Comms/TPAComm.vb | 14 +- .../LeftPanel/LeftPanelVM.vb | 14 +- .../MachGroupPanel/MyMachGroupVM.vb | 28 +- .../MachManagingThread/MachManaging.vb | 7 +- .../MachinePanel/MachinePanelVM.vb | 42 +- .../MainWindow/MainWindowVM.vb | 7 +- .../SceneHost/MySceneHostVM.vb | 46 +- .../SupervisorManager/SupervisorManagerVM.vb | 28 +- .../Utility/DbControllers.vb | 7 +- .../Utility/Dictionary.xaml | 509 +++++++++++------- .../AddSectionXMaterialWndVM.vb | 6 +- .../BTLPartManager/BTLPartManagerVM.vb | 7 +- .../CALCPanel/CALCPanelVM.vb | 7 +- .../ChangeMaterialWnd/ChangeMaterialWndVM.vb | 7 +- .../ChangeParameterWndVM.vb | 7 +- .../FreeContourManagerVM.vb | 49 +- .../MachGroupPanel/MyMachGroupVM.vb | 7 +- .../MainWindow/MainWindowVM.vb | 8 +- .../NewOpenProjectFileDialogVM.vb | 16 +- .../OnlyProdManager/OnlyProdManagerVM.vb | 20 +- .../OpenProjectFileDialogVM.vb | 28 +- .../ProjManager/ProjManagerVM.vb | 11 +- .../SceneHost/MySceneHostVM.vb | 16 +- .../Utility/DbControllers.vb | 7 +- .../WarehouseWnd/WarehouseWndVM.vb | 85 ++- 32 files changed, 785 insertions(+), 283 deletions(-) diff --git a/EgtBEAMWALL.Core/BTLModel/BTLFeatureM.vb b/EgtBEAMWALL.Core/BTLModel/BTLFeatureM.vb index 7c59e64c..7b7dd37a 100644 --- a/EgtBEAMWALL.Core/BTLModel/BTLFeatureM.vb +++ b/EgtBEAMWALL.Core/BTLModel/BTLFeatureM.vb @@ -547,7 +547,12 @@ Public Class BTLFeatureM bOk = True Else ' Impossibile creare una feature con questi valori - ERRORE - MessageBox.Show(EgtMsg(61852), EgtMsg(30007)) + 'MessageBox.Show(EgtMsg(61852), EgtMsg(30007)) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61852), EgtMsg(30007)) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61852), EgtMsg(30007)) + End If nFeatureId = EgtBeamModifyProcess(Me.nFeatureId, Me.nSelGRP, Me.nPRC, Me.nSelSIDE, "", Me.nPRID, Me.frFRAME, vPar, sPar, vParQ, nCrvId, nCrv2Id) SetFeatureId(nFeatureId) diff --git a/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb b/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb index 93a72e68..0e1f326e 100644 --- a/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb +++ b/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb @@ -62,7 +62,12 @@ Public Class EgtDataGrid 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) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(61883), newItems(index).Name, newItems(index).ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(61883), newItems(index).Name, newItems(index).ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning) + End If End Try Next @@ -85,7 +90,12 @@ Public Class EgtDataGrid CurrDataGrid.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex End If Catch ex As Exception - MessageBox.Show(String.Format(EgtMsg(61883), one.Name, one.ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning) + 'MessageBox.Show(String.Format(EgtMsg(61883), one.Name, one.ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(61883), one.Name, one.ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(61883), one.Name, one.ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning) + End If End Try Next End If diff --git a/EgtBEAMWALL.Core/Lib/NewMachGroupPanelVM.vb b/EgtBEAMWALL.Core/Lib/NewMachGroupPanelVM.vb index d6ac2cd0..43d34d45 100644 --- a/EgtBEAMWALL.Core/Lib/NewMachGroupPanelVM.vb +++ b/EgtBEAMWALL.Core/Lib/NewMachGroupPanelVM.vb @@ -211,9 +211,15 @@ Public Class NewMachGroupPanelVM Public Overridable Sub RemoveMachGroup() ' Calcolo indice del gruppo da cancellare Dim nSelectedMachGroupIndex As Integer = MachGroupVMList.IndexOf(SelectedMachGroup) + Dim m_MessageBoxResult As MessageBoxResult If MachGroupVMList.Count = 1 Then 'chiedo conferma prima di resettare il gruppo di lavorazione - Select Case MessageBox.Show("Eliminare?", "", MessageBoxButton.YesNo, MessageBoxImage.Question) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Eliminare?", "", MessageBoxButton.YesNo, MessageBoxImage.Question) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Eliminare?", "", MessageBoxButton.YesNo, MessageBoxImage.Question) + End If + Select Case m_MessageBoxResult Case MessageBoxResult.Yes ' cancello il gruppo corrente e ne creo uno nuovo con lo stesso nome m_MachGroupPanelM.OnPreRemoveCurrMachGroup() @@ -226,7 +232,12 @@ Public Class NewMachGroupPanelVM End Select Else 'chiedo conferma prima di cancellare il gruppo di lavorazione - Select Case MessageBox.Show("Eliminare?", "", MessageBoxButton.YesNo, MessageBoxImage.Question) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Eliminare?", "", MessageBoxButton.YesNo, MessageBoxImage.Question) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Eliminare?", "", MessageBoxButton.YesNo, MessageBoxImage.Question) + End If + Select Case m_MessageBoxResult Case MessageBoxResult.Yes ' cancello quello selezionato (ovvero il corrente) m_MachGroupPanelM.OnPreRemoveCurrMachGroup() diff --git a/EgtBEAMWALL.Supervisor/CALCPanel/CALCPanelVM.vb b/EgtBEAMWALL.Supervisor/CALCPanel/CALCPanelVM.vb index 0bdd52ba..c10dc9e1 100644 --- a/EgtBEAMWALL.Supervisor/CALCPanel/CALCPanelVM.vb +++ b/EgtBEAMWALL.Supervisor/CALCPanel/CALCPanelVM.vb @@ -91,7 +91,12 @@ Public Class CALCPanelVM Private Sub Calc_Ended(sender As Object, e As CalcEndEventArgs) If e.End_ <> CalcEndEventArgs.Results.OK Then - MessageBox.Show("Execution error (all processes are disabled)") + 'MessageBox.Show("Execution error (all processes are disabled)") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Execution error (all processes are disabled)") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Execution error (all processes are disabled)") + End If End If ' ciclo sui pezzi Dim bNotOkFound As Boolean = False diff --git a/EgtBEAMWALL.Supervisor/Comms/NUMAxiumComm.vb b/EgtBEAMWALL.Supervisor/Comms/NUMAxiumComm.vb index 11dcde6e..d9aea67f 100644 --- a/EgtBEAMWALL.Supervisor/Comms/NUMAxiumComm.vb +++ b/EgtBEAMWALL.Supervisor/Comms/NUMAxiumComm.vb @@ -474,9 +474,19 @@ Public Class NUMAxiumComm Private Sub objDGeneralFunction_VariableWritten(ByVal errorCode As Short) If errorCode <> 0 Then - MessageBox.Show("Error from VariableWritten:" & " " & errorCode.ToString()) + 'MessageBox.Show("Error from VariableWritten:" & " " & errorCode.ToString()) + If EgtBEAMWALL.Core.Configuration.bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Error from VariableWritten:" & " " & errorCode.ToString()) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Error from VariableWritten:" & " " & errorCode.ToString()) + End If Else - MessageBox.Show("VariableWritten successfully") + 'MessageBox.Show("VariableWritten successfully") + If EgtBEAMWALL.Core.Configuration.bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "VariableWritten successfully") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "VariableWritten successfully") + End If End If End Sub diff --git a/EgtBEAMWALL.Supervisor/Comms/NUMAxiumPcToolkitComm.vb b/EgtBEAMWALL.Supervisor/Comms/NUMAxiumPcToolkitComm.vb index 85fb4df4..84a436b0 100644 --- a/EgtBEAMWALL.Supervisor/Comms/NUMAxiumPcToolkitComm.vb +++ b/EgtBEAMWALL.Supervisor/Comms/NUMAxiumPcToolkitComm.vb @@ -741,9 +741,19 @@ Public Class NUMAxiumPcToolkitComm Private Sub objDGeneralFunction_VariableWritten(ByVal errorCode As Short) If errorCode <> 0 Then - MessageBox.Show("Error from VariableWritten:" & " " & errorCode.ToString()) + 'MessageBox.Show("Error from VariableWritten:" & " " & errorCode.ToString()) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Error from VariableWritten:" & " " & errorCode.ToString()) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Error from VariableWritten:" & " " & errorCode.ToString()) + End If Else - MessageBox.Show("VariableWritten successfully") + 'MessageBox.Show("VariableWritten successfully") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "VariableWritten successfully") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "VariableWritten successfully") + End If End If End Sub diff --git a/EgtBEAMWALL.Supervisor/Comms/NUMFlexiumComm.vb b/EgtBEAMWALL.Supervisor/Comms/NUMFlexiumComm.vb index 7976d51b..70f65fa2 100644 --- a/EgtBEAMWALL.Supervisor/Comms/NUMFlexiumComm.vb +++ b/EgtBEAMWALL.Supervisor/Comms/NUMFlexiumComm.vb @@ -446,9 +446,19 @@ Public Class NUMFlexiumComm Private Sub objDGeneralFunction_VariableWritten(ByVal errorCode As Short) If errorCode <> 0 Then - MessageBox.Show("Error from VariableWritten:" & " " & errorCode.ToString()) + 'MessageBox.Show("Error from VariableWritten:" & " " & errorCode.ToString()) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Error from VariableWritten:" & " " & errorCode.ToString()) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Error from VariableWritten:" & " " & errorCode.ToString()) + End If Else - MessageBox.Show("VariableWritten successfully") + 'MessageBox.Show("VariableWritten successfully") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "VariableWritten successfully") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "VariableWritten successfully") + End If End If End Sub diff --git a/EgtBEAMWALL.Supervisor/Comms/TPAComm.vb b/EgtBEAMWALL.Supervisor/Comms/TPAComm.vb index 67ebf9d7..09a6e44d 100644 --- a/EgtBEAMWALL.Supervisor/Comms/TPAComm.vb +++ b/EgtBEAMWALL.Supervisor/Comms/TPAComm.vb @@ -128,7 +128,12 @@ Public Class TPAComm AddHandler _remObject.RPCUpdate, m_Rem_RPCUpdateEventHandler AddHandler _remObject.VariableCommandExecuted, m_Rem_VariableCommandExecutedEventHandler Catch ex As System.Runtime.Remoting.RemotingException - Dim dR As MessageBoxResult = MessageBox.Show(ex.Message) + Dim dR As MessageBoxResult + If EgtBEAMWALL.Core.Configuration.bOnlyProd Then + dR = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, ex.Message) + Else + dR = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, ex.Message) + End If End Try ' creo classe che gestisce variabili m_RWVariableManager = RWVariableManager.CreateRWVariableManager(Me) @@ -190,7 +195,12 @@ Public Class TPAComm Private Sub RemoteObject_ServerError(ByVal sender As Object, ByVal seEA As ISOCNC.Remoting.ServerErrorEventArgs) m_ResultCallbackDlg(CommandTypes.ERROR_, CommandStates.ERROR_, ResultTypes.RESULT, "Server Error: " & seEA.[Error]) - Dim dr As MessageBoxResult = MessageBox.Show("Server Error: " & seEA.[Error]) + Dim dr As MessageBoxResult + If EgtBEAMWALL.Core.Configuration.bOnlyProd Then + dr = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Server Error: " & seEA.[Error]) + Else + dr = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Server Error: " & seEA.[Error]) + End If End Sub Private Sub RemoteObject_AxisCoordinatesUpdate(ByVal axisValue As Double, ByVal axisIndex As Integer) diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb index f035179d..e469b10e 100644 --- a/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb @@ -746,7 +746,12 @@ Public Class LeftPanelVM Dim SelMachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup ' se gia' prodotto, o in produzione non lo posso eliminare If SelMachGroup.dtStartTime <> Date.MinValue OrElse SelMachGroup.dtEndTime <> Date.MinValue OrElse SelMachGroup.bReadyForMachining OrElse SelMachGroup.bSentToMachine OrElse SelMachGroup.bResetWhileCutting Then - MessageBox.Show("Impossibile cancellare il grezzo") + 'MessageBox.Show("Impossibile cancellare il grezzo") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Impossibile cancellare il grezzo") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossibile cancellare il grezzo") + End If Return End If ' rimuovo da Db il MachGroup @@ -800,7 +805,12 @@ Public Class LeftPanelVM If CurrPart Is SelMachGroup.SelPart Then Exit For ElseIf CurrPart.nProduction_State < ItemState.Produced Then - MessageBox.Show("It is not possible to set as done a part that has before not already produced parts.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + 'MessageBox.Show("It is not possible to set as done a part that has before not already produced parts.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "It is not possible to set as done a part that has before not already produced parts.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "It is not possible to set as done a part that has before not already produced parts.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + End If Return End If Next diff --git a/EgtBEAMWALL.Supervisor/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.Supervisor/MachGroupPanel/MyMachGroupVM.vb index 5a1ecb44..c0f332ae 100644 --- a/EgtBEAMWALL.Supervisor/MachGroupPanel/MyMachGroupVM.vb +++ b/EgtBEAMWALL.Supervisor/MachGroupPanel/MyMachGroupVM.vb @@ -189,7 +189,12 @@ Public Class MyMachGroupVM ' creo nuova barra Dim RedoMachGroupVM As MyMachGroupVM = RedoRawPart() If IsNothing(RedoMachGroupVM) Then - MessageBox.Show("New RawPart creation failed!") + 'MessageBox.Show("New RawPart creation failed!") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "New RawPart creation failed!") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "New RawPart creation failed!") + End If Return End If ' salvo progetto con nuova barra @@ -222,7 +227,12 @@ Public Class MyMachGroupVM ' se progetto travi e lavorazione interrotta da reset If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM AndAlso (bResetWhileCutting OrElse dtStartTime <> DateTime.MinValue) And Not Map.refLeftPanelVM.bRestart Then ' chiedo se riprendere o rifare la barra da zero - Dim bRedo As MessageBoxResult = MessageBox.Show(EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information) + Dim bRedo As MessageBoxResult + If bOnlyProd Then + bRedo = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information) + Else + bRedo = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information) + End If Select Case bRedo Case MessageBoxResult.Yes ' segno da rifare pezzi non completamente lavorati @@ -274,7 +284,12 @@ Public Class MyMachGroupVM ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL AndAlso (bResetWhileCutting OrElse dtStartTime <> DateTime.MinValue) Then If False Then ' chiedo se riprendere o rifare il pannello da zero - Dim bRedo As MessageBoxResult = MessageBox.Show("Riprendere lavorazione pannello corrente?", "", MessageBoxButton.YesNo, MessageBoxImage.Information) + Dim bRedo As MessageBoxResult + If bOnlyProd Then + bRedo = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Riprendere lavorazione pannello corrente?", "", MessageBoxButton.YesNo, MessageBoxImage.Information) + Else + bRedo = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Riprendere lavorazione pannello corrente?", "", MessageBoxButton.YesNo, MessageBoxImage.Information) + End If Dim MachIndexVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = MACHINDEX) Select Case bRedo ' se ripresa @@ -404,7 +419,12 @@ Public Class MyMachGroupVM 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) + 'MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error) + End If End If End If Return Nothing diff --git a/EgtBEAMWALL.Supervisor/MachManagingThread/MachManaging.vb b/EgtBEAMWALL.Supervisor/MachManagingThread/MachManaging.vb index f7827dfa..016dae59 100644 --- a/EgtBEAMWALL.Supervisor/MachManagingThread/MachManaging.vb +++ b/EgtBEAMWALL.Supervisor/MachManagingThread/MachManaging.vb @@ -810,7 +810,12 @@ Public Class MachManaging bFileOk = True Catch ex As Exception m_ResultCallbackDlg(CommandTypes.START, CommandStates.ERROR_, ResultTypes.NULL, "Error in copying DEFAULT.ISO file") - MessageBox.Show("Impossibile copiare il file DEFAULT.ISO!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + 'MessageBox.Show("Impossibile copiare il file DEFAULT.ISO!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Impossibile copiare il file DEFAULT.ISO!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossibile copiare il file DEFAULT.ISO!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + End If Return End Try End If diff --git a/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb b/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb index 80ed952e..cf1d980b 100644 --- a/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb +++ b/EgtBEAMWALL.Supervisor/MachinePanel/MachinePanelVM.vb @@ -200,7 +200,12 @@ Public Class MachinePanelVM BeamMchsWinV.ShowDialog() Else ' Impossibile aprire l'Editor delle lavorazioni delle travi.
Mancano i file di configurazione. - Errore - MessageBox.Show(EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + 'MessageBox.Show(EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + End If End If Return True End Function @@ -219,7 +224,12 @@ Public Class MachinePanelVM WallMchsWinV.ShowDialog() Else ' Impossibile aprire l'Editor delle lavorazioni delle pareti.
Mancano i file di configurazione. - Errore - MessageBox.Show(EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + 'MessageBox.Show(EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + End If End If Return True End Function @@ -229,7 +239,12 @@ Public Class MachinePanelVM ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa) If Not EgtTdbReload() Then EgtOutLog("Impossible reloading tool Db") - MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + 'MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + End If Return End If @@ -255,7 +270,12 @@ Public Class MachinePanelVM ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa) If Not EgtMdbReload() Then EgtOutLog("Impossible reloading machining Db") - MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + 'MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + End If Return End If Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone") @@ -275,7 +295,12 @@ Public Class MachinePanelVM ' verifico che il file di configurazione attrezzaggio (lua) della macchina esista If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then EgtOutLog("SetUp error: SetUp configuration file doesn't exist ") - MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + 'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + End If Return End If ' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato, @@ -294,7 +319,12 @@ Public Class MachinePanelVM EgtLuaGetGlobIntVar("STU.ERR", nErr) If nErr = 0 Then If EgtGetHeadExitCount(sHead) = 0 Then - MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + 'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + End If Return End If End If diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb index 2ae1b854..bc2ac382 100644 --- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb @@ -213,7 +213,12 @@ Public Class MainWindowVM ' se macchina sta funzionando If Not IsNothing(Map.refMachManaging) AndAlso Map.refMachManaging.bConnected AndAlso (Map.refLeftPanelVM.SelOPState.Id <> OPStates.End AndAlso Map.refLeftPanelVM.SelOPState.Id <> OPStates.Unspecified) Then - MessageBox.Show("Impossible closing software while machine is working. If you want to close, first press reset and stop the machine!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + 'MessageBox.Show("Impossible closing software while machine is working. If you want to close, first press reset and stop the machine!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible closing software while machine is working. If you want to close, first press reset and stop the machine!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible closing software while machine is working. If you want to close, first press reset and stop the machine!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + End If Return End If ' disconnetto comunicazione con macchina diff --git a/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb index a076afe6..b358fe1d 100644 --- a/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb @@ -72,17 +72,34 @@ Public Class MySceneHostVM ' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore" Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3) Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1) - MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + 'MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + End If ' Altrimenti manca la licenza Else EgtOutLog("Problems with Licence") ' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore" Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6) Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1) - If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then + Dim m_MessageBoxResult As MessageBoxResult + If bOnlyProd Then + m_MessageBoxResult = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) + Else + m_MessageBoxResult = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) + End If + If m_MessageBoxResult = MessageBoxResult.OK Then ' Apro dialogo per richiesta file licenza - Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With { - .DefaultExt = ".lic", + 'Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With { + ' .DefaultExt = ".lic", + ' .Filter = "Licences (.lic)|*.lic", + ' .CheckFileExists = True, + ' .ValidateNames = True + '} + Dim LicDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { + .Title = EgtMsg(30006), .Filter = "Licences (.lic)|*.lic", .CheckFileExists = True, .ValidateNames = True @@ -255,7 +272,12 @@ Public Class MySceneHostVM EgtNewFile() Map.refMainWindowVM.SetTitle(" New - EgtBEAMWALL") Dim sMsg As String = EgtMsg(10003) & " '" & sFile & "'" 'Error opening file - MessageBox.Show(sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + 'MessageBox.Show(sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + End If End If MainScene.SetStatusNull() End Sub @@ -267,7 +289,12 @@ Public Class MySceneHostVM ' Se salvataggio non riuscito, esco subito If Not bOk Then Dim sMsg As String = EgtMsg(10004) & " '" & sFile & "'" 'Error saving file - MessageBox.Show(sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error + 'MessageBox.Show(sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error + End If Return End If ' Salvo nome ultimo file @@ -278,7 +305,12 @@ Public Class MySceneHostVM If nType = FT.BTL Or nType = FT.BTLX Then nFlag = GetMainPrivateProfileInt(S_IMPORT, K_BTLFLAG, EIB_FL.TS3_POS + EIB_FL.SORT + EIB_FL.USEUATTR) Else - MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error + 'MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error + End If End If End Sub diff --git a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb index fe47a86d..a67718c1 100644 --- a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb +++ b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb @@ -185,7 +185,12 @@ Public Class SupervisorManagerVM ' se macchina connessa e non in reset If Not IsNothing(Map.refMachManaging) AndAlso Map.refLeftPanelVM.SelOPState.Id <> OPStates.End Then ' impedisco cambio progetto - MessageBox.Show("Press reset before changing program!!") + 'MessageBox.Show("Press reset before changing program!!") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Press reset before changing program!!") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Press reset before changing program!!") + End If Return End If Dim sFilePath As String = "" @@ -216,7 +221,12 @@ Public Class SupervisorManagerVM If CurrentMachine.sMachineName <> TempCurrProd.sMachine Then ' rimuovo il file in apertura dalla lista degli MRU m_MruFiles.Remove(sFilePath) - MessageBox.Show(String.Format("Impossible opening a project done with {0} in a supervisor on a {1}!", {TempCurrProd.sMachine, CurrentMachine.sMachineName}), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + 'MessageBox.Show(String.Format("Impossible opening a project done with {0} in a supervisor on a {1}!", {TempCurrProd.sMachine, CurrentMachine.sMachineName}), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, String.Format("Impossible opening a project done with {0} in a supervisor on a {1}!", {TempCurrProd.sMachine, CurrentMachine.sMachineName}), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format("Impossible opening a project done with {0} in a supervisor on a {1}!", {TempCurrProd.sMachine, CurrentMachine.sMachineName}), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + End If EgtNewFile() EgtDraw() Map.refProjectVM.ProdMachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList())) @@ -235,7 +245,12 @@ Public Class SupervisorManagerVM ' inizializzo visibilita' bottone done per i Part Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.DonePart_Visibility)) Else - MessageBox.Show("Impossibile aprire il file!!") + 'MessageBox.Show("Impossibile aprire il file!!") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Impossibile aprire il file!!") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossibile aprire il file!!") + End If Map.refSceneHostVM.MainController.NewProject() Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL") m_bLoadingProd = False @@ -244,7 +259,12 @@ Public Class SupervisorManagerVM Return End If Else - MessageBox.Show("File non trovato!!") + 'MessageBox.Show("File non trovato!!") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "File non trovato!!") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "File non trovato!!") + End If Map.refSceneHostVM.MainController.NewProject() Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL") m_bLoadingProd = False diff --git a/EgtBEAMWALL.Supervisor/Utility/DbControllers.vb b/EgtBEAMWALL.Supervisor/Utility/DbControllers.vb index 3e8b77a2..aaef9f04 100644 --- a/EgtBEAMWALL.Supervisor/Utility/DbControllers.vb +++ b/EgtBEAMWALL.Supervisor/Utility/DbControllers.vb @@ -87,7 +87,12 @@ Module DbControllers End If Catch ex As Exception EgtOutLog("InitDb error: " & ex.ToString()) - MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error") + 'MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Db connection error!!", "Error") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Db connection error!!", "Error") + End If End End Try diff --git a/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml b/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml index 378cc765..d685469c 100644 --- a/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml @@ -1045,94 +1045,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + + + + + + - - + + - - + + - + + + + - + - + + + + + + + + + + + + + + + + + + + - - - + + + - + + + - - - - + - + - - - + + + - - - + + + - - - + + + @@ -1541,9 +1533,9 @@
- - - + + + - - - + + + - - - + + + - - - - + + + - - - + + + - - - + + + - - - - + + + + @@ -2199,6 +2177,24 @@ + + + + + + @@ -2322,4 +2318,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndVM.vb index 4bf62848..3c634eb2 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndVM.vb @@ -191,14 +191,16 @@ Public Class AddSectionXMaterialWndVM (Not NewSectionXMaterialList(Index).Alias_IsChecked And NewSectionXMaterialList(Index).dNewL < 0) OrElse (NewSectionXMaterialList(Index).Alias_IsChecked And IsNothing(NewSectionXMaterialList(Index).SelMaterialForSameSection)) OrElse (Not NewSectionXMaterialList(Index).Alias_IsChecked And (NewSectionXMaterialList(Index).nQuantity < 0 Or NewSectionXMaterialList(Index).nQuantity > 99)) Then - MessageBox.Show(IncorrectValues_Msg, Error_Msg) + 'MessageBox.Show(IncorrectValues_Msg, Error_Msg) + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) Return End If If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL AndAlso (Not NewSectionXMaterialList(Index).Alias_IsChecked And (NewSectionXMaterialList(Index).dNewW < 0 Or NewSectionXMaterialList(Index).dNewL < 0)) OrElse (NewSectionXMaterialList(Index).Alias_IsChecked And IsNothing(NewSectionXMaterialList(Index).SelMaterialForSameSection)) OrElse (Not NewSectionXMaterialList(Index).Alias_IsChecked And (NewSectionXMaterialList(Index).nQuantity < 0 Or NewSectionXMaterialList(Index).nQuantity > 99)) Then - MessageBox.Show(IncorrectValues_Msg, Error_Msg) + 'MessageBox.Show(IncorrectValues_Msg, Error_Msg) + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) Return End If Next diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb index f38af2f4..745fd28f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb @@ -289,7 +289,12 @@ Public Class BTLPartManagerVM dRawL = SParamlist(0).dL dRawW = SParamlist(0).dW Else - MessageBox.Show(EgtMsg(61975), EgtMsg(30007)) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61975), EgtMsg(30007)) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61975), EgtMsg(30007)) + End If + 'MessageBox.Show(EgtMsg(61975), EgtMsg(30007)) Return End If Else diff --git a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb index 1f31653d..58dc3463 100644 --- a/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/CALCPanel/CALCPanelVM.vb @@ -1126,7 +1126,12 @@ Public Class CALCPanelVM Friend Sub ChooseMachine() ' rendo visibile la CmBx per la scelta e il pulsante di conferma solo se il Proj corrente non ha associato alcun Prod If ProjectManagerVM.CurrProj.nProdId > 0 AndAlso Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then - MessageBox.Show(EgtMsg(61929), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61929), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61929), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation) + End If + 'MessageBox.Show(EgtMsg(61929), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation) Else SetChooseMachine_Visibility(True) End If diff --git a/EgtBEAMWALL.ViewerOptimizer/ChangeMaterialWnd/ChangeMaterialWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/ChangeMaterialWnd/ChangeMaterialWndVM.vb index c7d3d71d..47bd3a6e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ChangeMaterialWnd/ChangeMaterialWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ChangeMaterialWnd/ChangeMaterialWndVM.vb @@ -129,7 +129,12 @@ Public Class ChangeMaterialWndVM Not IsNothing(m_SelWhMaterial) AndAlso m_SelWhMaterial <> "" Then RaiseEvent m_CloseWindow(True) Else - MessageBox.Show(EgtMsg(61858), EgtMsg(30007)) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61858), EgtMsg(30007)) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61858), EgtMsg(30007)) + End If + 'MessageBox.Show(EgtMsg(61858), EgtMsg(30007)) End If End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/ChangeParameterWnd/ChangeParameterWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/ChangeParameterWnd/ChangeParameterWndVM.vb index 7c17752b..5b993418 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ChangeParameterWnd/ChangeParameterWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ChangeParameterWnd/ChangeParameterWndVM.vb @@ -108,7 +108,12 @@ Public Class ChangeParameterWndVM Not IsNothing(m_SelParam) AndAlso m_SelParam.sName <> "" Then RaiseEvent m_CloseWindow(True) Else - MessageBox.Show(EgtMsg(61858), EgtMsg(30007)) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61858), EgtMsg(30007)) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61858), EgtMsg(30007)) + End If + 'MessageBox.Show(EgtMsg(61858), EgtMsg(30007)) End If End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/FreeContourManager/FreeContourManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/FreeContourManager/FreeContourManagerVM.vb index a1185d16..9c056804 100644 --- a/EgtBEAMWALL.ViewerOptimizer/FreeContourManager/FreeContourManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/FreeContourManager/FreeContourManagerVM.vb @@ -83,7 +83,14 @@ Public Class FreeContourManagerVM NotifyPropertyChanged(NameOf(TextAngle_Visibility)) Case FreeContourTypes.TWO ' chiedo conferma - If MessageBox.Show(EgtMsg(61862), "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then + Dim m_MessageBoxResult As MessageBoxResult + If bOnlyProd Then + m_MessageBoxResult = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61862), "", MessageBoxButton.YesNo, MessageBoxImage.Warning) + Else + m_MessageBoxResult = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61862), "", MessageBoxButton.YesNo, MessageBoxImage.Warning) + End If + 'If MessageBox.Show(EgtMsg(61862), "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then + If m_MessageBoxResult <> MessageBoxResult.Yes Then m_SelType = FreeContourTypes.TWO NotifyPropertyChanged(NameOf(SelType)) Return @@ -367,7 +374,7 @@ Public Class FreeContourManagerVM m_SelType = FreeContourTypes.TWO End If End If - ' se nuova senza percorsi + ' se nuova senza percorsi Else ' imposto modalita' un percorso m_SelType = FreeContourTypes.ONE @@ -428,7 +435,7 @@ Public Class FreeContourManagerVM Dim frFace As New Frame3d EgtBeamGetSideData(SelFeature.nSelSIDE, frFace) Dim frFrame As Frame3d = SelFeature.BTLFeatureM.frFRAME - frFrame.ToGlob( frFace) + frFrame.ToGlob(frFace) EgtSetGridFrame(frFrame) EgtSetGridShow(True, True) Map.refSceneHostVM.MainScene.CPlaneView() @@ -444,7 +451,7 @@ Public Class FreeContourManagerVM End Sub Friend Sub Close(bSave As Boolean) - If not m_bIsActive Then Return + If Not m_bIsActive Then Return m_bIsActive = False ' gestisco modifiche ai percorsi If bSave Then @@ -518,7 +525,7 @@ Public Class FreeContourManagerVM EgtErase(nSideAngTextLayer) nSideAngTextLayer = GDB_ID.NULL ' riporto griglia globale e la nascondo - EgtSetGridFrame( New Frame3d()) + EgtSetGridFrame(New Frame3d()) EgtSetGridShow(False, False) ' se il progetto non era modificato ed esco senza salvare, resetto lo stato di modificato If Not m_bAlreadyModified And Not bSave Then @@ -649,7 +656,7 @@ Public Class FreeContourManagerVM If sSideAngSplit.Count - 1 >= Index Then StringToDoubleAdv(sSideAngSplit(Index), dSideAng, True) End If - Dim sSideAng As String = DoubleToString( dSideAng, 2) & "°" + Dim sSideAng As String = DoubleToString(dSideAng, 2) & "°" Dim TextId As Integer = EgtCreateText(nSideAngTextLayer, ptText, sSideAng, 20) EgtSetInfo(TextId, "SideAng", dSideAng) SideAngValues.Add(New SideAngle(TextId, Index, dSideAng)) @@ -742,7 +749,7 @@ Public Class FreeContourManagerVM End If ElseIf bChangedStart Then ' non faccio nulla perche' gestito sopra - ' se apro percorso + ' se apro percorso ElseIf Not bNewIsClosed AndAlso bOldIsClosed AndAlso Index = NewAngleList.Count Then ' cancello il testo del lato rimosso nMovedIndex = OldAngleList.FindIndex(Function(x) AreSamePointApprox(x, NewAngleList(CurrIndex - 1))) @@ -750,7 +757,7 @@ Public Class FreeContourManagerVM Dim NewIndex As Integer = (nPointsQty + nOffset) Mod nPointsQty EgtErase(SideAngValues(nOffset).nId) NewSideAngValues.RemoveAt(NewSideAngValues.Count - 1) - ' se chiudo percorso + ' se chiudo percorso ElseIf bNewIsClosed AndAlso Not bOldIsClosed AndAlso Index = OldAngleList.Count Then ' creo il testo del lato aggiunto Dim ptText As Point3d @@ -759,21 +766,21 @@ Public Class FreeContourManagerVM ' aggiungo punto e incremento indice di confronto per riallineare successivo NewSideAngValues.Add(New SideAngle(TextId, NewSideAngValues.Count - 1, 0)) '' percorso aperto - ' punti coincidono: verifico che i punti coincidano e non siano il centro del percorso simmetrico + ' punti coincidono: verifico che i punti coincidano e non siano il centro del percorso simmetrico ElseIf Not bNewIsClosed AndAlso nNewIndex <= NewAngleList.Count - 1 AndAlso nOldIndex <= OldAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso Not (Index = nPointsQty / 2 AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1))) Then If Index < nPointsQty AndAlso nOldIndex <= SideAngValues.Count - 1 Then NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue)) End If - ' punti simmetrici: verifico se sono simmetrici o se coincidono ma i precedenti sono simmetrici + ' punti simmetrici: verifico se sono simmetrici o se coincidono ma i precedenti sono simmetrici ElseIf Not bNewIsClosed AndAlso Not bOldIsClosed AndAlso NewAngleList.Count = OldAngleList.Count AndAlso (AreSamePointApprox(NewAngleList(Index), OldAngleList(nPointsQty - Index)) OrElse (AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then If Index < nPointsQty Then - Dim sText As String = DoubleToString( SideAngValues(nPointsQty - 1 - Index).dValue, 2) + Dim sText As String = DoubleToString(SideAngValues(nPointsQty - 1 - Index).dValue, 2) EgtModifyText(SideAngValues(Index).nId, sText) NewSideAngValues.Add(New SideAngle(SideAngValues(nPointsQty - 1 - Index).nId, NewSideAngValues.Count, SideAngValues(nPointsQty - 1 - Index).dValue)) End If - ' punto spostato: verifico che non coincidano ma che i precedenti o i successivi coincidano + ' punto spostato: verifico che non coincidano ma che i precedenti o i successivi coincidano ElseIf Not bNewIsClosed AndAlso ((Index = nPointsQty AndAlso Index <= OldAngleList.Count - 1 AndAlso Not AreSamePointApprox(NewAngleList(Index), OldAngleList(Index)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(Index - 1))) OrElse (nOldIndex + 1 <= OldAngleList.Count - 1 AndAlso nNewIndex + 1 <= NewAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex + 1), OldAngleList(nOldIndex + 1)))) Then @@ -796,20 +803,20 @@ Public Class FreeContourManagerVM NewSideAngValues.Add(New SideAngle(SideAngValues(Index).nId, NewSideAngValues.Count, SideAngValues(Index).dValue)) End If '' percorso chiuso - ' punti coincidono: verifico che i punti coincidano e non siano inizio, fine o centro del percorso simmetrico + ' punti coincidono: verifico che i punti coincidano e non siano inizio, fine o centro del percorso simmetrico ElseIf bNewIsClosed AndAlso nNewIndex <= NewAngleList.Count - 1 AndAlso nOldIndex <= OldAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso Not ((Index = 0 AndAlso AreSamePointApprox(NewAngleList(Index + 1), OldAngleList(nPointsQty - 1))) OrElse ((Index = nPointsQty / 2 OrElse Index = nPointsQty) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then If Index < nPointsQty AndAlso nOldIndex < SideAngValues.Count Then NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue)) End If - ' punti simmetrici: verifico se sono simmetrici o se coincidono ma i precedenti sono simmetrici + ' punti simmetrici: verifico se sono simmetrici o se coincidono ma i precedenti sono simmetrici ElseIf bNewIsClosed AndAlso bOldIsClosed AndAlso (AreSamePointApprox(NewAngleList(Index), OldAngleList(nPointsQty - Index)) OrElse (AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then If Index < nPointsQty Then NewSideAngValues.Add(New SideAngle(SideAngValues(nPointsQty - 1 - Index).nId, NewSideAngValues.Count, SideAngValues(nPointsQty - 1 - Index).dValue)) End If - ' punto spostato: verifico che non coincidano ma che i precedenti o i successivi coincidano + ' punto spostato: verifico che non coincidano ma che i precedenti o i successivi coincidano ElseIf (nOldIndex + 1 <= OldAngleList.Count - 1 AndAlso nNewIndex + 1 <= NewAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex + 1), OldAngleList(nOldIndex + 1))) OrElse (bNewIsClosed AndAlso nOldIndex + 1 = OldAngleList.Count AndAlso nNewIndex + 1 = NewAngleList.Count AndAlso AreSamePointApprox(NewAngleList(1), OldAngleList(1))) Then ' aggiorno posizione testo precedente @@ -830,7 +837,7 @@ Public Class FreeContourManagerVM EgtMove(SideAngValues(nOldIndex).nId, vtDistance) NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue)) End If - ' punto aggiunto: Verifico che il punto successivo coincida con il vecchio corrente o che sia stato aggiunto in fondo + ' punto aggiunto: Verifico che il punto successivo coincida con il vecchio corrente o che sia stato aggiunto in fondo ElseIf (nNewIndex + 1 <= NewAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex + 1), OldAngleList(nOldIndex))) OrElse (nOldIndex = OldAngleList.Count AndAlso OldAngleList.Count < NewAngleList.Count) Then ' se non e' percorso aperto e primo punto @@ -852,7 +859,7 @@ Public Class FreeContourManagerVM ' aggiungo punto e incremento indice di confronto per riallineare successivo NewSideAngValues.Insert(TextIndex, New SideAngle(TextId, TextIndex, 0)) nOldIndex -= 1 - ' punto tolto: verifico che il punto coincida con il vecchio successivo o che sia stato tolto in fondo + ' punto tolto: verifico che il punto coincida con il vecchio successivo o che sia stato tolto in fondo ElseIf (nOldIndex + 1 <= OldAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex + 1))) OrElse (nNewIndex = NewAngleList.Count AndAlso OldAngleList.Count > NewAngleList.Count) Then ' non aggiungo nulla, ma cancello testo @@ -865,7 +872,7 @@ Public Class FreeContourManagerVM EgtAtParamPoint(m_nNewPathId, If(Index = 0, NewAngleList.Count, Index) - 0.5, ptNew) Dim vtDistance As Vector3d = ptNew - ptOld EgtMove(SideAngValues(If(Index = 0, OldAngleList.Count, Index) - 1).nId, vtDistance) - ' spostato o ruotato intero percorso + ' spostato o ruotato intero percorso Else ' aggiorno posizione testo successivo Dim ptOld As Point3d @@ -896,7 +903,7 @@ Public Class FreeContourManagerVM Dim dAng As Double StringToDoubleAdv(Map.refFreeContourInputVM.Text, dAng, True) EgtSetInfo(m_nSelTextId, "SideAng", dAng) - Dim sAng As String = DoubleToString( dAng, 2) & "°" + Dim sAng As String = DoubleToString(dAng, 2) & "°" EgtModifyText(m_nSelTextId, sAng) Dim SideAngValue As SideAngle = SideAngValues.First(Function(x) x.nId = m_nSelTextId) SideAngValue.dValue = dAng @@ -944,9 +951,9 @@ Public Class FreeContourManagerVM Map.refFreeContourInputVM.PrepareInputBox(EgtMsg(62007), EgtMsg(62008), "", False, False) Dim dSideAng As Double = 0 EgtGetInfo(nId, "SideAng", dSideAng) - Dim sSideAng As String = DoubleToString( dSideAng, 2) + Dim sSideAng As String = DoubleToString(dSideAng, 2) Map.refFreeContourInputVM.SetInputBoxText(sSideAng) - ' se sto aprendo percorso chiuso + ' se sto aprendo percorso chiuso ElseIf Map.refFreeContourManagerVM.bIsOpeningCurveCompo Then Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.OPENCOMPO) m_bIsOpeningCurveCompo = False diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb index 9a48815f..c0c8a7b9 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb @@ -470,7 +470,12 @@ Public Class MyMachGroupVM BeamWallMachGroup.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) + 'MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error) + End If End If Return Nothing End If diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb index 1d86247f..476015f5 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb @@ -251,7 +251,13 @@ Public Class MainWindowVM End If Dim TimeFromLastBackup As TimeSpan = DateTime.Now - LastBackupDate If TimeFromLastBackup > TimeSpan.FromDays(Map.refConfigurationPageVM.SelReminder.Id) Then - If MessageBox.Show(String.Format(EgtMsg(61987), Map.refConfigurationPageVM.SelReminder.Name), EgtMsg(15002), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.Yes Then + Dim m_MessageBoxResult As MessageBoxResult + If bOnlyProd Then + m_MessageBoxResult = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(61987), Map.refConfigurationPageVM.SelReminder.Name), EgtMsg(15002), MessageBoxButton.YesNo, MessageBoxImage.Warning) + Else + m_MessageBoxResult = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(61987), Map.refConfigurationPageVM.SelReminder.Name), EgtMsg(15002), MessageBoxButton.YesNo, MessageBoxImage.Warning) + End If + If m_MessageBoxResult = MessageBoxResult.Yes Then Map.refConfigurationPageVM.Backup(True) End If End If diff --git a/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb b/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb index a48df99c..710c96bb 100644 --- a/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/NewOpenProjectFileDialog/NewOpenProjectFileDialogVM.vb @@ -144,7 +144,13 @@ Public Class NewOpenProjectFileDialogVM Dim ProjListIndex As Integer = m_ProjectList.IndexOf(SelProject) ' verifico se proj selezionato e' il corrente If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso SelProject.ProjFileList.Any(Function(x) x.nProjId = ProjectManagerVM.CurrProj.nProjId) Then - If m_ProjectType = ProjectType.PROJ AndAlso MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Warning) = MessageBoxResult.Cancel Then + Dim m_MessageBoxResult As MessageBoxResult + If bOnlyProd Then + m_MessageBoxResult = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Warning) + Else + m_MessageBoxResult = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Warning) + End If + If m_ProjectType = ProjectType.PROJ AndAlso m_MessageBoxResult = MessageBoxResult.Cancel Then Return Else m_ChangeOpenedProjectOnCancel = True @@ -152,7 +158,13 @@ Public Class NewOpenProjectFileDialogVM End If ' verifico se prod selezionato e' il corrente If Not IsNothing(ProjectManagerVM.CurrProd) AndAlso SelProject.ProdFileVM.nProdId = ProjectManagerVM.CurrProd.nProdId Then - If m_ProjectType = ProjectType.PROD AndAlso MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Warning) = MessageBoxResult.Cancel Then + Dim m_MessageBoxResult As MessageBoxResult + If bOnlyProd Then + m_MessageBoxResult = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Warning) + Else + m_MessageBoxResult = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Warning) + End If + If m_ProjectType = ProjectType.PROD AndAlso m_MessageBoxResult = MessageBoxResult.Cancel Then Return Else m_ChangeOpenedProjectOnCancel = True diff --git a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb index e04e1737..d0e94607 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OnlyProdManager/OnlyProdManagerVM.vb @@ -412,7 +412,8 @@ Public Class OnlyProdManagerVM End Try ' se almeno un errore, mostro log If bGlobalError Then - MessageBox.Show(Application.Current.MainWindow, sImportMessage, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error + 'MessageBox.Show(Application.Current.MainWindow, sImportMessage, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, sImportMessage, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error End If End If End If @@ -502,7 +503,8 @@ Public Class OnlyProdManagerVM ' inizializzo nuovo progetto PROD NewProdFromProj() Else - MessageBox.Show(EgtMsg(61876)) + 'MessageBox.Show(EgtMsg(61876)) + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61876)) End If Map.refMainWindowVM.UpdateTitle() NotifyPropertyChanged(NameOf(MruFileNames)) @@ -581,7 +583,8 @@ Public Class OnlyProdManagerVM Dim nFlag As Integer = GetMainPrivateProfileInt(S_IMPORT, sBTLFlag, EIB_FL.TS3_POS + EIB_FL.SORT + EIB_FL.USEUATTR) EgtBeamSetFlag(nFlag) Else - MessageBox.Show(EgtMsg(61871)) + 'MessageBox.Show(EgtMsg(61871)) + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61871)) Map.refSceneHostVM.MainController.NewProject() Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL") End If @@ -727,7 +730,7 @@ Public Class OnlyProdManagerVM ' .CheckFileExists = True, ' .ValidateNames = True} Dim BTLDlg As New EgtBEAMWALL.Core.OnlyProdEgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Import BTL", + .Title = EgtMsg(61840), .Filter = "BTL (*.btl)|*.btl" & "|BTLX (*.btlx)|*.btlx", .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), @@ -932,7 +935,7 @@ Public Class OnlyProdManagerVM ' .CheckFileExists = True, ' .ValidateNames = True} Dim BTLDlg As New EgtBEAMWALL.Core.OnlyProdEgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Update BTL", + .Title = EgtMsg(61834), .Filter = "BTL (*.btl)|*.btl" & "|BTLX (*.btlx)|*.btlx", .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), @@ -1412,7 +1415,7 @@ Public Class OnlyProdManagerVM ' .Filter = "ProjectExport (*.ngexp)|*.ngexp", ' .FileName = CurrProd.nProdId.ToString("0000") & " - " & CurrProd.sBTLFileName & " - ProjectExport"} Dim ExportDlg As New EgtBEAMWALL.Core.OnlyProdEgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Save File", + .Title = EgtMsg(30001), .Filter = "ProjectExport (*.ngexp)|*.ngexp", .FileName = CurrProd.nProdId.ToString("0000") & " - " & CurrProd.sBTLFileName & " - ProjectExport" } @@ -1470,7 +1473,8 @@ Public Class OnlyProdManagerVM End Using Catch ex1 As Exception EgtOutLog("Exception in zip: " & ex1.ToString()) - MessageBox.Show("Error in export file creation!") + 'MessageBox.Show("Error in export file creation!") + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Error in export file creation!") End Try ' elimino layer di esportazione EgtErase(nImpExpPartId) @@ -1516,7 +1520,7 @@ Public Class OnlyProdManagerVM ' .ValidateNames = True} 'If ImportDlg.ShowDialog() <> True Then Return Dim ImportDlg As New EgtBEAMWALL.Core.OnlyProdEgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Import File", + .Title = EgtMsg(61839), .Filter = "ProjectExport (*.ngexp)|*.ngexp", .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), .CheckFileExists = True, diff --git a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb index 1b917c1a..d02419d8 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb @@ -120,12 +120,22 @@ Public Class OpenProjectFileDialogVM If m_ProjectType = ProjectType.PROJ Then ' verifico se proj selezionato e' il corrente If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso SelProject.nProjId = ProjectManagerVM.CurrProj.nProjId Then - MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + End If + 'MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) Return End If ' verifico se proj selezionato ha prod If SelProject.nProdId > 0 Then - MessageBox.Show(EgtMsg(61873), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61873), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61873), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + End If + 'MessageBox.Show(EgtMsg(61873), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) Return End If Map.refProjManagerVM.m_MruFiles.Remove(SelProject.sProjPath) @@ -149,12 +159,22 @@ Public Class OpenProjectFileDialogVM ElseIf m_ProjectType = ProjectType.PROD Then ' verifico se prod selezionato e' il corrente If Not IsNothing(ProjectManagerVM.CurrProd) AndAlso SelProject.nProdId = ProjectManagerVM.CurrProd.nProdId Then - MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + End If + 'MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) Return End If ' verifico se ci sono grezzi mandati al supervisore If DbControllers.m_ProdController.IsAnyInSupervisor(SelProject.nProdId) Then - MessageBox.Show(EgtMsg(61874), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61874), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61874), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) + End If + 'MessageBox.Show(EgtMsg(61874), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) Return End If Map.refProdManagerVM.m_MruFiles.Remove(SelProject.sProdPath) diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb index 2b0193b0..4edcb4b8 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb @@ -614,7 +614,7 @@ Public Class ProjManagerVM ' .CheckFileExists = True, ' .ValidateNames = True} Dim BTLDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Import BTL", + .Title = EgtMsg(61840), .Filter = "BTL (*.btl)|*.btl" & "|BTLX (*.btlx)|*.btlx", .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), @@ -865,7 +865,8 @@ Public Class ProjManagerVM ' .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), ' .CheckFileExists = True, ' .ValidateNames = True} - Dim BTLDlg As New Microsoft.Win32.OpenFileDialog() With { + Dim BTLDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { + .Title = EgtMsg(61834), .Filter = "BTL (*.btl)|*.btl" & "|BTLX (*.btlx)|*.btlx", .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), @@ -1342,8 +1343,8 @@ Public Class ProjManagerVM 'Dim ExportDlg As New Microsoft.Win32.SaveFileDialog() With {.DefaultExt = ".ngexp", ' .Filter = "ProjectExport (*.ngexp)|*.ngexp", ' .FileName = CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - ProjectExport"} - Dim ExportDlg As New Microsoft.Win32.SaveFileDialog() With { - .DefaultExt = ".ngexp", + Dim ExportDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { + .Title = EgtMsg(61838), .Filter = "ProjectExport (*.ngexp)|*.ngexp", .FileName = CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - ProjectExport" } @@ -1446,7 +1447,7 @@ Public Class ProjManagerVM ' .ValidateNames = True} 'If ImportDlg.ShowDialog() <> True Then Return Dim ImportDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Import File", + .Title = EgtMsg(61839), .Filter = "ProjectExport (*.ngexp)|*.ngexp", .InitialDirectory = If(Directory.Exists(sDir), sDir, ""), .CheckFileExists = True, diff --git a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb index 9cf3a8f1..6a425065 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb @@ -84,14 +84,25 @@ Public Class MySceneHostVM ' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore" Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3) Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1) - MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + 'MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + End If ' Altrimenti manca la licenza Else EgtOutLog("Problems with Licence") ' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore" Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6) Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1) - If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then + Dim m_MessageBoxResult As MessageBoxResult + If bOnlyProd Then + m_MessageBoxResult = EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) + Else + m_MessageBoxResult = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) + End If + If m_MessageBoxResult = MessageBoxResult.OK Then ' Apro dialogo per richiesta file licenza 'Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With { ' .DefaultExt = ".lic", @@ -100,6 +111,7 @@ Public Class MySceneHostVM ' .ValidateNames = True '} Dim LicDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { + .Title = EgtMsg(30006), .Filter = "Licences (.lic)|*.lic", .CheckFileExists = True, .ValidateNames = True diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/DbControllers.vb b/EgtBEAMWALL.ViewerOptimizer/Utility/DbControllers.vb index 01cbbc7e..8d842b68 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/DbControllers.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/DbControllers.vb @@ -83,7 +83,12 @@ Public Module DbControllers End If Catch ex As Exception EgtOutLog("InitDb error: " & ex.ToString()) - MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error") + 'MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error") + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Db connection error!!", "Error") + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, "Db connection error!!", "Error") + End If End End Try diff --git a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndVM.vb index 9d95e37a..d89359d3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/WarehouseWnd/WarehouseWndVM.vb @@ -624,7 +624,12 @@ Public Class WarehouseWndVM If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then ' Verifico che i valori siano tutti > 0 If dStartOffset <= 0 OrElse dOffset <= 0 Then - MessageBox.Show(IncorrectValues_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + End If + 'MessageBox.Show(IncorrectValues_Msg, Error_Msg) Return End If ' Se i valori sono tutti > 0 li scrivo nel file INI @@ -643,7 +648,12 @@ Public Class WarehouseWndVM ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then ' Verifico che i valori siano tutti > 0 If dKerf <= 0 OrElse dOffset <= 0 Then - MessageBox.Show(IncorrectValues_Msg, Error_Msg) + 'MessageBox.Show(IncorrectValues_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + End If Return End If ' Se i valori sono tutti > 0 li scrivo nel file INI @@ -667,12 +677,22 @@ Public Class WarehouseWndVM If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then ' Verifico che i valori siano tutti > 0 If dStartOffset < 0 OrElse dOffset < 0 Then - MessageBox.Show(IncorrectValues_Msg, Error_Msg) + 'MessageBox.Show(IncorrectValues_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + End If Return End If For Each SPItem In SParamList If IsNothing(SParamList(ParamIndex - 1).SectXMat) OrElse SParamList(ParamIndex - 1).dL <= 0 Then - MessageBox.Show(IncorrectValues_Msg, Error_Msg) + 'MessageBox.Show(IncorrectValues_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + End If Return End If ParamIndex += 1 @@ -702,12 +722,22 @@ Public Class WarehouseWndVM ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then ' Verifico che i valori siano tutti > 0 If dKerf < 0 OrElse dOffset < 0 Then - MessageBox.Show(IncorrectValues_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + End If + 'MessageBox.Show(IncorrectValues_Msg, Error_Msg) Return End If For Each SPItem In SParamList If IsNothing(SParamList(ParamIndex - 1).SectXMat) OrElse SParamList(ParamIndex - 1).dW <= 0 OrElse SParamList(ParamIndex - 1).dL <= 0 Then - MessageBox.Show(IncorrectValues_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + End If + 'MessageBox.Show(IncorrectValues_Msg, Error_Msg) Return End If ParamIndex += 1 @@ -827,14 +857,24 @@ Public Class WarehouseWndVM End If Next If bExist Then - MessageBox.Show(ValueExists_Msg, Error_Msg) + 'MessageBox.Show(ValueExists_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, ValueExists_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, ValueExists_Msg, Error_Msg) + End If Else SParamList.Add(New SParam(dLValue)) sNewL = Nothing NewBeamParam_Visibility = Visibility.Collapsed End If Else - MessageBox.Show(IncorrectValue_Msg, Error_Msg) + 'MessageBox.Show(IncorrectValue_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValue_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValue_Msg, Error_Msg) + End If End If Case MachineType.WALL If Not IsNothing(sNewW) Then StringToLenAdv(sNewW, dWValue, True) @@ -849,7 +889,12 @@ Public Class WarehouseWndVM End If Next If bExist Then - MessageBox.Show(ValuesExist_Msg, Error_Msg) + 'MessageBox.Show(ValuesExist_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, ValuesExist_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, ValuesExist_Msg, Error_Msg) + End If Else SParamList.Add(New SParam(dWValue, dLValue)) sNewW = Nothing @@ -857,7 +902,12 @@ Public Class WarehouseWndVM NewWallParam_Visibility = Visibility.Collapsed End If Else - MessageBox.Show(IncorrectValues_Msg, Error_Msg) + 'MessageBox.Show(IncorrectValues_Msg, Error_Msg) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, IncorrectValues_Msg, Error_Msg) + End If End If End Select End Sub @@ -898,7 +948,13 @@ Public Class WarehouseWndVM Public Sub RemoveParam() If Not IsNothing(SelSParam) Then If SelSParam.Equals(SelCurrentS) Then - If MessageBox.Show(RemoveCurrent_Msg, Attention_Msg, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then + Dim m_MessageBoxResult As MessageBoxResult + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, RemoveCurrent_Msg, Attention_Msg, MessageBoxButtons.YesNo, MessageBoxIcon.Question) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, RemoveCurrent_Msg, Attention_Msg, MessageBoxButtons.YesNo, MessageBoxIcon.Question) + End If + If m_MessageBoxResult = DialogResult.Yes Then SParamList.Remove(SelSParam) m_RemovedParamsCount += 1 If SParamList.Count > 0 Then @@ -979,7 +1035,12 @@ Public Class WarehouseWndVM If WhWallParamList.Last().dMaxThickness > WhWallParamList.Last().dMinThickness Then WhWallParamList.Add(New WhWallParam(0, CurrentMachine.dMaxRawH)) Else - System.Windows.MessageBox.Show(EgtMsg(61777), "", MessageBoxButton.OK, MessageBoxImage.Warning) + 'System.Windows.MessageBox.Show(EgtMsg(61777), "", MessageBoxButton.OK, MessageBoxImage.Warning) + If bOnlyProd Then + EgtBEAMWALL.Core.OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61777), "", MessageBoxButton.OK, MessageBoxImage.Warning) + Else + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61777), "", MessageBoxButton.OK, MessageBoxImage.Warning) + End If End If Else WhWallParamList.Add(New WhWallParam(0, CurrentMachine.dMaxRawH)) From 05b2b1d73f17438e7e2a1509b242a78001bda452 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 6 Aug 2024 09:28:11 +0200 Subject: [PATCH 114/126] -cambiato messaggi --- .../OnlyProdGeneral_ConfigurationPageV.xaml | 7 ++- EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj | 7 +++ EgtBEAMWALL.Core/Lib/NewMachGroupPanelVM.vb | 8 +-- .../LoadingWnd/LoadingWndHelper.vb | 7 ++- .../LoadingWnd/OnlyProdLoadingWndV.xaml | 55 ++++++++++++++++++ .../LoadingWnd/OnlyProdLoadingWndV.xaml.vb | 36 ++++++++++++ EgtBEAMWALL.Core/Utility/Configuration.vb | 56 ++++++++++++++++++- EgtBEAMWALL.Supervisor/Application.xaml.vb | 12 +++- .../CALCPanel/CALCPanelVM.vb | 4 +- EgtBEAMWALL.Supervisor/Comms/NUMAxiumComm.vb | 8 +-- .../Comms/NUMAxiumPcToolkitComm.vb | 8 +-- .../Comms/NUMFlexiumComm.vb | 8 +-- EgtBEAMWALL.Supervisor/Comms/TPAComm.vb | 6 +- .../EgtBEAMWALL.Supervisor.vbproj | 14 +++++ .../LeftPanel/LeftPanelVM.vb | 8 +-- .../MachGroupPanel/MyMachGroupVM.vb | 8 +-- .../MachManagingThread/MachManaging.vb | 4 +- .../MainMenu/MainMenuV.xaml | 4 -- .../MainMenu/OnlyProdMainMenuV.xaml | 28 ++++++++++ .../MainMenu/OnlyProdMainMenuV.xaml.vb | 3 + .../MainWindow/MainWindowVM.vb | 4 +- .../MainWindow/OnlyProdMainWindowV.xaml | 47 ++++++++++++++++ .../MainWindow/OnlyProdMainWindowV.xaml.vb | 47 ++++++++++++++++ .../SupervisorManager/SupervisorManagerVM.vb | 16 +++--- .../Utility/DbControllers.vb | 4 +- .../Utility/Dictionary.xaml | 37 ++++++++++++ .../Application.xaml.vb | 43 -------------- .../BTLViewModel/BTLParamVM.vb | 8 +-- .../CALCPanel/CALCPanelVM.vb | 4 +- .../ConfigurationPage/ConfigurationPageVM.vb | 22 ++++++-- .../NestingRunningWnd/NestingRunningWndVM.vb | 8 +-- .../OnlyProdManager/OnlyProdManagerVM.vb | 20 +++---- .../ProdManager/ProdManagerVM.vb | 6 +- .../ProjManager/ProjManagerVM.vb | 14 ++--- .../RawPartManager/RawPartManagerVM.vb | 4 +- .../Utility/DbControllers.vb | 4 +- 36 files changed, 444 insertions(+), 135 deletions(-) create mode 100644 EgtBEAMWALL.Core/LoadingWnd/OnlyProdLoadingWndV.xaml create mode 100644 EgtBEAMWALL.Core/LoadingWnd/OnlyProdLoadingWndV.xaml.vb create mode 100644 EgtBEAMWALL.Supervisor/MainMenu/OnlyProdMainMenuV.xaml create mode 100644 EgtBEAMWALL.Supervisor/MainMenu/OnlyProdMainMenuV.xaml.vb create mode 100644 EgtBEAMWALL.Supervisor/MainWindow/OnlyProdMainWindowV.xaml create mode 100644 EgtBEAMWALL.Supervisor/MainWindow/OnlyProdMainWindowV.xaml.vb diff --git a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml index 2dbbe774..a14d88fb 100644 --- a/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml +++ b/EgtBEAMWALL.Core/ConfigurationPage/OnlyProdGeneral_ConfigurationPageV.xaml @@ -88,10 +88,13 @@ Margin="0,0,2.5,0"/>
- + + + + + + + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb index 888405bb..2415658b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/OnlyProdConfigurationPageV.xaml.vb @@ -1,3 +1,2 @@ Public Class OnlyProdConfigurationPageV - End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index a8c56e29..c186cabb 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -207,6 +207,9 @@ ChangeMaterialWndV.xaml + + OnlyProdCheckVersionV.xaml + OnlyProdConfigurationPageV.xaml @@ -609,6 +612,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -1355,6 +1362,9 @@ 1.16.0 + + 1.0.2408.817 + 6.4.4 @@ -1364,6 +1374,9 @@ 1.3.5 + + 1.0.2592.51 + 10.0.22621.2428 diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb index a86a421e..f691e3fc 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb @@ -5,6 +5,7 @@ Imports EgtBEAMWALL.Core.ConstBeam Imports EgtBEAMWALL.DataLayer.DatabaseModels Imports EgtUILib Imports EgtWPFLib5 +Imports EgwProxy.LiMan Public Class MainMenuVM Inherits VMBase @@ -152,6 +153,18 @@ Public Class MainMenuVM End Get End Property + ' Testo che mostra il numero di versioni da aggiornare + Private m_NumVersion As Integer + Public ReadOnly Property NumVersion As Integer + Get + Return m_NumVersion + End Get + End Property + Friend Sub SetNumVersion(value As Integer) + m_NumVersion = value + NotifyPropertyChanged(NameOf(NumVersion)) + End Sub + #Region "Messages" Public ReadOnly Property Viewer_Msg As String @@ -184,6 +197,12 @@ Public Class MainMenuVM End Get End Property + Public ReadOnly Property NVersion_Msg As String + Get + Return EgtMsg(61747) + End Get + End Property + #Region "ToolTip" 'Proprietà ToolTip @@ -214,6 +233,8 @@ Public Class MainMenuVM Else m_Supervisor_Visibility = Visibility.Collapsed End If + ' imposto numero di versioni da aggiornare + SetNumVersion(GetNumVersion()) ' imposto timer di apertura da ottimizzatore m_OpenPage_Timer.Interval = TimeSpan.FromMilliseconds(500) AddHandler m_OpenPage_Timer.Tick, AddressOf OpenPage_Tick @@ -224,6 +245,18 @@ Public Class MainMenuVM #Region "METHODS" + Friend Function GetNumVersion() As Integer + ' eseguo test per comunicazione server (ping, alive) + Dim m_commLib As New DataSyncro(EgtBEAMWALL.Core.Configuration.sServerAddressRelease) + If m_commLib.CheckRemote() Then + Else + OnlyProdEgtMessageBoxV.Show(Application.Current.MainWindow, "Test Ping: KO") + End If + ' Recupero la lista delle versioni del programma filtrate per quella attuale + Dim ReleaseList As List(Of DTO.ReleaseDTO) = m_commLib.ReleaseGetFiltLimit(K_BEAMWALL, EgtBEAMWALL.Core.Configuration.ActualVersion, "2.5.15.0") + Return ReleaseList.Where(Function(r) r.IsPermitted).Count + End Function + Friend Sub SetMainMenuIsEnabled(bIsEnabled As Boolean) m_MainMenu_IsEnabled = bIsEnabled NotifyPropertyChanged(NameOf(MainMenu_IsEnabled)) diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml b/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml index 49b131c7..3fd0e2c1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/OnlyProdMainMenuV.xaml @@ -16,11 +16,11 @@ Command="{Binding Supervisor_Command}" Visibility="{Binding Supervisor_Visibility}" Style="{StaticResource OnlyProdMainMenu_Button}" - Margin="-30,0,0,0"/> + Margin="-42.5,0,0,0"/> + + + + diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowM.vb b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowM.vb index 664c8e74..0076c675 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowM.vb @@ -191,6 +191,14 @@ Public Class MainWindowM End Get End Property + ' Indirizzo server (DEBUG) + Private m_sServerAddressRelease As String + Friend ReadOnly Property sServerAddressRelease As String + Get + Return m_sServerAddressRelease + End Get + End Property + #End Region ' FIELDS #Region "CONSTRUCTOR" @@ -339,6 +347,10 @@ Public Class MainWindowM m_bMachConfig = GetMainPrivateProfileInt(S_MACH, K_MACHCONFIG, 0) = 1 ' e lo imposto nel core Core.Configuration.SetModifySetup(m_bMachConfig) + ' Recupero Server Address + GetMainPrivateProfileString(S_GENERAL, K_SERVERADDRESS, "", m_sServerAddressRelease) + ' e lo imposto nel core + Core.Configuration.SetServerAddressRelease(m_sServerAddressRelease) ' Info su opzioni chiave EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString()) diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml index c6f32c4d..640473fa 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/Dictionary.xaml @@ -362,6 +362,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -133,14 +133,14 @@ Command="{Binding PrintLabel_Command}" IsEnabled="{Binding LeftPanel_IsEnabled}" Visibility="{Binding PrintLabel_Visibility}" - Style="{StaticResource LeftPanel_Button}"> + Style="{StaticResource OnlyProdLeftPanel_Button}"> diff --git a/EgtBEAMWALL.Supervisor/MDIPage/MDIPageV.xaml b/EgtBEAMWALL.Supervisor/MDIPage/MDIPageV.xaml index f5944bd1..dd5430f6 100644 --- a/EgtBEAMWALL.Supervisor/MDIPage/MDIPageV.xaml +++ b/EgtBEAMWALL.Supervisor/MDIPage/MDIPageV.xaml @@ -19,6 +19,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" + ColumnHeaderBackground="{x:Null}" BindingColumns="{Binding MDICommandColumns}" Style="{StaticResource DataGrid_CustomHighLight}"> diff --git a/EgtBEAMWALL.Supervisor/MachineLogPage/MachineLogPageV.xaml b/EgtBEAMWALL.Supervisor/MachineLogPage/MachineLogPageV.xaml index 4abe25d4..054e4c00 100644 --- a/EgtBEAMWALL.Supervisor/MachineLogPage/MachineLogPageV.xaml +++ b/EgtBEAMWALL.Supervisor/MachineLogPage/MachineLogPageV.xaml @@ -72,6 +72,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" + ColumnHeaderBackground="{x:Null}" BindingColumns="{Binding MachineLogColumns}"> diff --git a/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml b/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml index 195f5343..793ed6bd 100644 --- a/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml @@ -193,7 +193,61 @@ - + + + + + + + + + + + + + + + + @@ -254,7 +308,7 @@
- + @@ -1160,9 +1214,6 @@ + + diff --git a/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndV.xaml index 36b7dd3a..c98d0b5d 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndV.xaml @@ -25,6 +25,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="5" + ColumnHeaderBackground="{x:Null}" BindingColumns="{Binding SectXMatColumns}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index 214ab489..3953e1a8 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -190,9 +190,6 @@ OnlyProdAddRawPartWndV.xaml - - OnlyProdBTLPartListV.xaml - BTLPartManagerV.xaml @@ -238,6 +235,9 @@ OnlyProdInstrumentPanelV.xaml + + OnlyProdBTLPartListV.xaml + OnlyProdFeatureInPartInRawPartListV.xaml @@ -592,10 +592,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile @@ -648,6 +644,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + Designer MSBuild:Compile diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml index b52cee90..8dd7ac04 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml @@ -20,6 +20,7 @@ PreviewMouseUp="DataGrid_PreviewMouseUp" PreviewMouseMove="DataGrid_PreviewMouseMove" Margin="0,0,0,5" + ColumnHeaderBackground="{x:Null}" EgtBEAMWALL:MultiSelectorBehaviours.SynchronizedSelectedItems="{Binding Tag.SelBTLParts, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}" BindingColumns="{Binding PartColumns}" diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml index 75a97bb9..ef3471b8 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListV.xaml @@ -16,10 +16,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" - ColumnHeaderBackground="{StaticResource DataGrid.Static.Background}" - ColumnHeaderForeground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" - ColumnHeaderFontWeight="Normal" - ColumnHeaderPadding="0,2,0,2" + ColumnHeaderBackground="{x:Null}" BindingColumns="{Binding FeatureInPartInRawPartColumns}" BeginningEdit="FeatureInPartInRawPartList_BeginningEdit" Style="{StaticResource DataGrid_CustomHighLight}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml index aff15670..6d125e30 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureListV.xaml @@ -16,10 +16,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" - ColumnHeaderBackground="{StaticResource DataGrid.Static.Background}" - ColumnHeaderForeground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" - ColumnHeaderFontWeight="Normal" - ColumnHeaderPadding="0,2,0,2" + ColumnHeaderBackground="{x:Null}" IsEnabled="{Binding FeatureList_IsEnabled}" BindingColumns="{Binding FeatureColumns}" Style="{StaticResource DataGrid_CustomHighLight}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdBTLPartListV.xaml similarity index 100% rename from EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml rename to EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdBTLPartListV.xaml diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdBTLPartListV.xaml.vb similarity index 100% rename from EgtBEAMWALL.ViewerOptimizer/BTLPartList/OnlyProdBTLPartListV.xaml.vb rename to EgtBEAMWALL.ViewerOptimizer/ItemParamList/OnlyProdBTLPartListV.xaml.vb diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml index bca169ff..cc3068ea 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PParameterListV.xaml @@ -12,10 +12,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" - ColumnHeaderBackground="{StaticResource DataGrid.Static.Background}" - ColumnHeaderForeground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" - ColumnHeaderFontWeight="Normal" - ColumnHeaderPadding="0,2,0,2" + ColumnHeaderBackground="{x:Null}" ItemsSource="{Binding Tag.PBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PParameterListV}}}" SelectedItem="{Binding Tag.SelPBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PParameterListV}}}" IsEnabled="{Binding PParameterList_IsEnabled}" diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml index 2de81c33..b45b5d90 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListV.xaml @@ -18,10 +18,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" - ColumnHeaderBackground="{StaticResource DataGrid.Static.Background}" - ColumnHeaderForeground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" - ColumnHeaderFontWeight="Normal" - ColumnHeaderPadding="0,2,0,2" + ColumnHeaderBackground="{x:Null}" BindingColumns="{Binding PartInRawPartColumns}" BeginningEdit="PartInRawPartList_BeginningEdit" Style="{StaticResource DataGrid_CustomHighLight}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml index 632a6853..050cf94a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml @@ -12,10 +12,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" - ColumnHeaderBackground="{StaticResource DataGrid.Static.Background}" - ColumnHeaderForeground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" - ColumnHeaderFontWeight="Normal" - ColumnHeaderPadding="0,2,0,2" + ColumnHeaderBackground="{x:Null}" ItemsSource="{Binding Tag.QBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}" SelectedItem="{Binding Tag.SelQBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}" BeginningEdit="QParameterList_BeginningEdit" diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/RawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/RawPartListV.xaml index 2f6a2260..319a46a1 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/RawPartListV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/RawPartListV.xaml @@ -16,10 +16,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" - ColumnHeaderBackground="{StaticResource DataGrid.Static.Background}" - ColumnHeaderForeground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" - ColumnHeaderFontWeight="Normal" - ColumnHeaderPadding="0,2,0,2" + ColumnHeaderBackground="{x:Null}" BindingColumns="{Binding RawPartColumns}" BeginningEdit="RawPartList_BeginningEdit" Style="{StaticResource DataGrid_CustomHighLight}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb index 7206a57e..8669b10b 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb @@ -733,7 +733,7 @@ Public Class MySceneHostVM ' scrivo info proj e type su layer BtlInfo Dim nBTLInfoLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO) EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, ProjectManagerVM.nLoadingProjId) - EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, ProjectManagerVM.CurrProd.nType) + EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, ProjectManagerVM.CurrProj.nType) ' scrivo info proj su layer AsseBase Dim nAsseBaseLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE) EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, ProjectManagerVM.nLoadingProjId) diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml index 27570ec7..dc9d1cbb 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml @@ -28,6 +28,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" + ColumnHeaderBackground="{x:Null}" BindingColumns="{Binding OptimizerStatisticsColumns}"> @@ -115,6 +116,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" + ColumnHeaderBackground="{x:Null}" BindingColumns="{Binding RawPartStatisticsColumns}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsV.xaml index 588ec096..072aaba2 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsV.xaml @@ -19,6 +19,7 @@ ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,5" + ColumnHeaderBackground="{x:Null}" BindingColumns="{Binding StatisticsColumns}"> diff --git a/EgtBEAMWALL.ViewerOptimizer/StatusBar/StatusBarV.xaml b/EgtBEAMWALL.ViewerOptimizer/StatusBar/StatusBarV.xaml index 9d2f300b..2dd2c626 100644 --- a/EgtBEAMWALL.ViewerOptimizer/StatusBar/StatusBarV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/StatusBar/StatusBarV.xaml @@ -44,9 +44,9 @@