diff --git a/EgtBEAMWALL.Core/EgtMessageBox/EgtMessageBoxV.xaml.vb b/EgtBEAMWALL.Core/EgtMessageBox/EgtMessageBoxV.xaml.vb index 923258ec..ea87e2f1 100644 --- a/EgtBEAMWALL.Core/EgtMessageBox/EgtMessageBoxV.xaml.vb +++ b/EgtBEAMWALL.Core/EgtMessageBox/EgtMessageBoxV.xaml.vb @@ -1,6 +1,5 @@ -Imports System.Windows -Imports System.Windows.Threading -Imports EgtWPFLib5 +Imports EgtWPFLib5 +Imports System.Windows Public Class EgtMessageBoxV @@ -26,18 +25,6 @@ Public Class EgtMessageBoxV #Region "METHODS" - Protected Overrides Sub OnSourceInitialized(e As EventArgs) - MyBase.OnSourceInitialized(e) - Me.WindowStartupLocation = WindowStartupLocation.CenterScreen - End Sub - - Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded - Dispatcher.BeginInvoke(Sub() - Me.Topmost = True - Me.Activate() - End Sub, DispatcherPriority.ContextIdle) - End Sub - ''' ''' Apre una EgtMessageBox con un messaggio che ritorna un risultato ''' diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb index 5ceff3b2..3b4061eb 100644 --- a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb @@ -17,7 +17,7 @@ Imports System.Windows - + diff --git a/EgtBEAMWALL.Core/Themes/Generic.xaml b/EgtBEAMWALL.Core/Themes/Generic.xaml index cfab2853..00a42d9b 100644 --- a/EgtBEAMWALL.Core/Themes/Generic.xaml +++ b/EgtBEAMWALL.Core/Themes/Generic.xaml @@ -302,11 +302,7 @@ - - - - - + diff --git a/EgtBEAMWALL.Optimizer/AboutBoxWindow/AboutBoxV.xaml.vb b/EgtBEAMWALL.Optimizer/AboutBoxWindow/AboutBoxV.xaml.vb index 71fe6687..b94be8ed 100644 --- a/EgtBEAMWALL.Optimizer/AboutBoxWindow/AboutBoxV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/AboutBoxWindow/AboutBoxV.xaml.vb @@ -1,4 +1,5 @@ Imports EgtUILib +Imports EgtBEAMWALL.Core Public Class AboutBoxV diff --git a/EgtBEAMWALL.Optimizer/AddFeatureWnd/AddFeatureWndVM.vb b/EgtBEAMWALL.Optimizer/AddFeatureWnd/AddFeatureWndVM.vb index 80cc18c4..a1d9ad03 100644 --- a/EgtBEAMWALL.Optimizer/AddFeatureWnd/AddFeatureWndVM.vb +++ b/EgtBEAMWALL.Optimizer/AddFeatureWnd/AddFeatureWndVM.vb @@ -106,7 +106,11 @@ Public Class AddFeatureWndVM GetMacroListDefault(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName) ' ricavo lista file Macro Custom GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName) - MacroList_IsEnabled = If(MacroCustomList.Count > 0, True, False) + If MacroCustomList.Count > 0 Then + MacroList_IsEnabled = True + Else + MacroList_IsEnabled = False + End If End If End If NotifyPropertyChanged(NameOf(nSelPRC)) diff --git a/EgtBEAMWALL.Optimizer/AddPartWnd/AddPartWndVM.vb b/EgtBEAMWALL.Optimizer/AddPartWnd/AddPartWndVM.vb index f3d95c1e..c932b241 100644 --- a/EgtBEAMWALL.Optimizer/AddPartWnd/AddPartWndVM.vb +++ b/EgtBEAMWALL.Optimizer/AddPartWnd/AddPartWndVM.vb @@ -147,7 +147,7 @@ Public Class AddPartWndVM #Region "COMMANDS" -#Region "Ok_Command" +#Region "Ok" Public ReadOnly Property Ok_Command As ICommand Get @@ -169,7 +169,7 @@ Public Class AddPartWndVM End If End Sub -#End Region ' Ok_Command +#End Region ' Ok #End Region ' COMMANDS diff --git a/EgtBEAMWALL.Optimizer/AddRawPartWnd/AddRawPartWndVM.vb b/EgtBEAMWALL.Optimizer/AddRawPartWnd/AddRawPartWndVM.vb index 4154f4f5..bd71720c 100644 --- a/EgtBEAMWALL.Optimizer/AddRawPartWnd/AddRawPartWndVM.vb +++ b/EgtBEAMWALL.Optimizer/AddRawPartWnd/AddRawPartWndVM.vb @@ -143,7 +143,7 @@ Public Class AddRawPartWndVM #Region "COMMANDS" -#Region "Ok_Command" +#Region "Ok" Public ReadOnly Property Ok_Command As ICommand Get @@ -167,7 +167,7 @@ Public Class AddRawPartWndVM RaiseEvent m_CloseWindow(True) End Sub -#End Region ' Ok_Command +#End Region ' Ok #End Region ' COMMANDS diff --git a/EgtBEAMWALL.Optimizer/Application.xaml b/EgtBEAMWALL.Optimizer/Application.xaml index 9e6a55b0..24d93560 100644 --- a/EgtBEAMWALL.Optimizer/Application.xaml +++ b/EgtBEAMWALL.Optimizer/Application.xaml @@ -1,7 +1,7 @@  + xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"> diff --git a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb index 6697bcbe..2a325287 100644 --- a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb +++ b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb @@ -838,7 +838,7 @@ Public Class BTLDataWndVM #Region "COMMANDS" -#Region "Ok_Command" +#Region "Ok" Public ReadOnly Property Ok_Command As ICommand Get @@ -865,9 +865,9 @@ Public Class BTLDataWndVM RaiseEvent m_CloseWindow(True) End Sub -#End Region ' Ok_Command +#End Region ' Ok -#Region "Cancel_Command" +#Region "Cancel" Public ReadOnly Property Cancel_Command As ICommand Get @@ -882,7 +882,7 @@ Public Class BTLDataWndVM RaiseEvent m_CloseWindow(False) End Sub -#End Region ' Cancel_Command +#End Region ' Cancel #End Region ' COMMANDS diff --git a/EgtBEAMWALL.Optimizer/BTLPartManager/BTLPartManagerV.xaml b/EgtBEAMWALL.Optimizer/BTLPartManager/BTLPartManagerV.xaml index 5901b41b..e21bb7bd 100644 --- a/EgtBEAMWALL.Optimizer/BTLPartManager/BTLPartManagerV.xaml +++ b/EgtBEAMWALL.Optimizer/BTLPartManager/BTLPartManagerV.xaml @@ -1,66 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - + diff --git a/EgtBEAMWALL.Optimizer/BTLPartManager/BTLPartManagerVM.vb b/EgtBEAMWALL.Optimizer/BTLPartManager/BTLPartManagerVM.vb index 76bd21fc..496b4c74 100644 --- a/EgtBEAMWALL.Optimizer/BTLPartManager/BTLPartManagerVM.vb +++ b/EgtBEAMWALL.Optimizer/BTLPartManager/BTLPartManagerVM.vb @@ -183,7 +183,7 @@ Public Class BTLPartManagerVM #Region "COMMANDS" -#Region "CopyPart_Command" +#Region "CopyPart" Public ReadOnly Property CopyPart_Command As ICommand Get @@ -207,9 +207,9 @@ Public Class BTLPartManagerVM End If End Sub -#End Region ' CopyPart_Command +#End Region ' CopyPart -#Region "RemovePart_Command" +#Region "RemovePart" Public ReadOnly Property RemovePart_Command As ICommand Get @@ -297,9 +297,9 @@ Public Class BTLPartManagerVM EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx()) End Sub -#End Region ' RemovePart_Command +#End Region ' RemovePart -#Region "Simulate_Command" +#Region "SimulateCommand" Public ReadOnly Property Simulate_Command As ICommand Get @@ -344,9 +344,9 @@ Public Class BTLPartManagerVM Return True End Function -#End Region ' Simulate_Command +#End Region ' SimulateCommand -#Region "Edit_Command" +#Region "Edit" Public ReadOnly Property Edit_Command As ICommand Get @@ -391,9 +391,9 @@ Public Class BTLPartManagerVM Map.refProjectVM.SetLeftPanel_Opacity(0.2) End Sub -#End Region ' Edit_Command +#End Region ' Edit -#Region "ResetCalc_Command" +#Region "ResetCalc" Public ReadOnly Property ResetCalc_Command As ICommand Get @@ -422,7 +422,7 @@ Public Class BTLPartManagerVM End If End Sub -#End Region ' ResetCalc_Command +#End Region ' ResetCalc #End Region ' COMMANDS diff --git a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLFeatureVM.vb b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLFeatureVM.vb index aa325c4f..e3d2cd7b 100644 --- a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLFeatureVM.vb +++ b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLFeatureVM.vb @@ -293,12 +293,6 @@ Public Class BTLFeatureVM End Set End Property - Public ReadOnly Property sFeature_Name As String - Get - Return $"[{nSelGRP}-{nPRC:000}] {sName}" - End Get - End Property - #Region "Messages" Public ReadOnly Property Edit_ToolTip As String @@ -487,7 +481,7 @@ Public Class BTLFeatureVM #Region "COMMANDS" -#Region "DeleteFeature_Command" +#Region "DeleteFeature" Public ReadOnly Property DeleteFeature_Command As ICommand Get @@ -502,9 +496,9 @@ Public Class BTLFeatureVM Map.refFeatureListManagerVM.RemoveFeature() End Sub -#End Region ' DeleteFeature_Command +#End Region ' DeleteFeature -#Region "Edit_Command" +#Region "Edit" Public ReadOnly Property Edit_Command As ICommand Get @@ -520,9 +514,9 @@ Public Class BTLFeatureVM Map.refFreeContourManagerVM.Open() End Sub -#End Region ' Edit_Command +#End Region ' Edit -#Region "Save_Command" +#Region "Save" Public ReadOnly Property Save_Command As ICommand Get @@ -543,9 +537,9 @@ Public Class BTLFeatureVM Map.refFreeContourManagerVM.Close(True) End Sub -#End Region ' Save_Command +#End Region ' Save -#Region "Cancel_Command" +#Region "Cancel" Public ReadOnly Property Cancel_Command As ICommand Get @@ -561,9 +555,9 @@ Public Class BTLFeatureVM Map.refFreeContourManagerVM.Close(False) End Sub -#End Region ' Cancel_Command +#End Region ' Cancel -#Region "Strategy_Command" +#Region "Strategy" Public ReadOnly Property Strategy_Command As ICommand Get @@ -582,9 +576,9 @@ Public Class BTLFeatureVM Map.refForcedStrategyPanelVM.Init(BTLFeatureM) End Sub -#End Region ' Strategy_Command +#End Region ' Strategy -#Region "EditFeature_Command" +#Region "EditFeature" Public ReadOnly Property EditFeature_Command As ICommand Get @@ -613,7 +607,7 @@ Public Class BTLFeatureVM EgtDraw() End Sub -#End Region ' EditFeature_Command +#End Region ' EditFeature #End Region ' COMMANDS diff --git a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLPartVM.vb b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLPartVM.vb index 3df1001d..7209b7f6 100644 --- a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLPartVM.vb +++ b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLPartVM.vb @@ -18,7 +18,6 @@ Public Class BTLPartVM Return m_BTLPartM End Get End Property - Private m_BTLStructureM As BTLStructureM Public ReadOnly Property nPartId As Integer @@ -1376,13 +1375,13 @@ Public Class BTLPartVM Public ReadOnly Property CALC_ROT_Visibility As Visibility Get - Return If(m_BTLPartM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Hidden) + Return If(m_BTLPartM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed) End Get End Property Public ReadOnly Property CALC_FALL_Visibility As Visibility Get - Return If(m_BTLPartM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Hidden) + Return If(m_BTLPartM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed) End Get End Property @@ -2234,26 +2233,11 @@ Public Class BTLPartVM Return True End Function - Public Sub BackRotation(Optional bUpdateSection As Boolean = False, Optional bRedraw As Boolean = True) - ' salvo sezione impostata - Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection - ' ruoto - Rotation(False, Map.refProjectVM.BTLStructureVM.nPROJTYPE, bRedraw) - ' imposto lock - bLockRotation = True - ' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi) - If bUpdateSection AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM AndAlso CurrSection <> SectionXMaterial.Empty Then - ' se esiste, imposto sezione inversa - Dim InverseSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SectionList.FirstOrDefault(Function(x) x.dH = CurrSection.dW AndAlso x.dW = CurrSection.dH AndAlso x.sMaterial(0) = CurrSection.sMaterial(0)) - If Not IsNothing(InverseSection) Then Map.refProjectVM.BTLStructureVM.SetSelSection(InverseSection) - End If - End Sub - #End Region ' METHODS #Region "COMMANDS" -#Region "Invert_Command" +#Region "Invert" Public ReadOnly Property Invert_Command As ICommand Get @@ -2275,9 +2259,41 @@ Public Class BTLPartVM NotifyPropertyChanged(NameOf(sINVERTED)) End Sub -#End Region ' Invert_Command +#End Region ' Invert -#Region "ForwardRotation_Command" +#Region "BackRotation" + + Public ReadOnly Property BackRotation_Command As ICommand + Get + If m_cmdBackRotation Is Nothing Then + m_cmdBackRotation = New Command(AddressOf BackRotationCmd) + End If + Return m_cmdBackRotation + End Get + End Property + + Public Sub BackRotationCmd() + BackRotation(True) + End Sub + + Public Sub BackRotation(Optional bUpdateSection As Boolean = False, Optional bRedraw As Boolean = True) + ' salvo sezione impostata + Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection + ' ruoto + Rotation(False, Map.refProjectVM.BTLStructureVM.nPROJTYPE, bRedraw) + ' imposto lock + bLockRotation = True + ' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi) + If bUpdateSection AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM AndAlso CurrSection <> SectionXMaterial.Empty Then + ' se esiste, imposto sezione inversa + Dim InverseSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SectionList.FirstOrDefault(Function(x) x.dH = CurrSection.dW AndAlso x.dW = CurrSection.dH AndAlso x.sMaterial(0) = CurrSection.sMaterial(0)) + If Not IsNothing(InverseSection) Then Map.refProjectVM.BTLStructureVM.SetSelSection(InverseSection) + End If + End Sub + +#End Region ' BackRotation + +#Region "ForwardRotation" Public ReadOnly Property ForwardRotation_Command As ICommand Get @@ -2306,7 +2322,7 @@ Public Class BTLPartVM End If End Sub -#End Region ' ForwardRotation_Command +#End Region ' ForwardRotation ' Comando inutilizzato ma conservato per eventuale rotazione a causa di importazione con rotazione sbagliata #Region "XRotation" @@ -2349,7 +2365,7 @@ Public Class BTLPartVM #End Region ' XRotation -#Region "PartColour_Command" +#Region "PartColour" Public ReadOnly Property PartColour_Command As ICommand Get @@ -2381,9 +2397,9 @@ Public Class BTLPartVM Return True End Function -#End Region ' PartColour_Command +#End Region ' PartColour -#Region "Verify_Command" +#Region "Verify" Public ReadOnly Property Verify_Command As ICommand Get @@ -2401,9 +2417,9 @@ Public Class BTLPartVM Return End Sub -#End Region ' Verify_Command +#End Region ' Verify -#Region "AddToRawPart_Command" +#Region "AddToRawPart" Public ReadOnly Property AddToRawPart_Command As ICommand Get @@ -2698,9 +2714,9 @@ Public Class BTLPartVM Return True End Function -#End Region ' AddToRawPart_Command +#End Region ' AddToRawPart -#Region "SelectAllFeature_Command" +#Region "SelectAllFeature" Public ReadOnly Property SelectAllFeature_Command As ICommand Get @@ -2716,9 +2732,9 @@ Public Class BTLPartVM NotifyPropertyChanged(NameOf(bDOALL)) End Sub -#End Region ' SelectAllFeature_Command +#End Region ' SelectAllFeature -#Region "DeselectAllFeature_Command" +#Region "DeselectAllFeature" Public ReadOnly Property DeselectAllFeature_Command As ICommand Get @@ -2734,9 +2750,9 @@ Public Class BTLPartVM NotifyPropertyChanged(NameOf(bDOALL)) End Sub -#End Region ' DeselectAllFeature_Command +#End Region ' DeselectAllFeature -#Region "SelectItemFeature_Command" +#Region "SelectItemFeature" Public ReadOnly Property SelectItemFeature_Command As ICommand Get @@ -2758,9 +2774,9 @@ Public Class BTLPartVM Next End Sub -#End Region ' SelectItemFeature_Command +#End Region ' SelectItemFeature -#Region "DeselectItemFeature_Command" +#Region "DeselectItemFeature" Public ReadOnly Property DeselectItemFeature_Command As ICommand Get @@ -2782,7 +2798,7 @@ Public Class BTLPartVM Next End Sub -#End Region ' DeselectItemFeature_Command +#End Region ' DeselectItemFeature #End Region ' COMMANDS diff --git a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb index f92759d4..6080533a 100644 --- a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb +++ b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb @@ -1305,7 +1305,7 @@ Public Class BTLStructureVM #Region "COMMANDS" -#Region "DeletePart_Command" +#Region "DeletePart" Public ReadOnly Property DeletePart_Command() As ICommand Get @@ -1330,9 +1330,9 @@ Public Class BTLStructureVM End If End Sub -#End Region ' DeletePart_Command +#End Region ' DeletePart -#Region "Data_Command" +#Region "Data" Public ReadOnly Property Data_Command As ICommand Get @@ -1348,9 +1348,9 @@ Public Class BTLStructureVM BTLDataWnd.ShowDialog() End Sub -#End Region ' Data_Command +#End Region ' Data -#Region "AddPart_Command" +#Region "AddPart" Public ReadOnly Property AddPart_Command As ICommand Get @@ -1402,9 +1402,9 @@ Public Class BTLStructureVM End If End Sub -#End Region ' AddPart_Command +#End Region ' AddPart -#Region "UpdateBTL_Command" +#Region "UpdateBTL" Public ReadOnly Property UpdateBTL_Command As ICommand Get @@ -1944,7 +1944,7 @@ Public Class BTLStructureVM EgtZoom(ZM.ALL) End Sub -#End Region ' UpdateBTL_Command +#End Region ' UpdateBTL #End Region ' Commands diff --git a/EgtBEAMWALL.Optimizer/BlockedWnd/BlockedWndVM.vb b/EgtBEAMWALL.Optimizer/BlockedWnd/BlockedWndVM.vb index 12430477..ff49696e 100644 --- a/EgtBEAMWALL.Optimizer/BlockedWnd/BlockedWndVM.vb +++ b/EgtBEAMWALL.Optimizer/BlockedWnd/BlockedWndVM.vb @@ -112,7 +112,7 @@ Public Class BlockedWndVM #Region "COMMANDS" -#Region "Save_Command" +#Region "Save" Public ReadOnly Property Save_Command As ICommand Get @@ -130,9 +130,9 @@ Public Class BlockedWndVM DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "") End Sub -#End Region ' Save_Command +#End Region ' Save -#Region "DoNotSave_Command" +#Region "DoNotSave" Public ReadOnly Property DoNotSave_Command As ICommand Get @@ -148,7 +148,7 @@ Public Class BlockedWndVM DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "") End Sub -#End Region ' DoNotSave_Command +#End Region ' DoNotSave #End Region ' COMMANDS diff --git a/EgtBEAMWALL.Optimizer/EgtBEAMWALL.Optimizer.vbproj b/EgtBEAMWALL.Optimizer/EgtBEAMWALL.Optimizer.vbproj index de52c221..b9410cc9 100644 --- a/EgtBEAMWALL.Optimizer/EgtBEAMWALL.Optimizer.vbproj +++ b/EgtBEAMWALL.Optimizer/EgtBEAMWALL.Optimizer.vbproj @@ -1007,15 +1007,6 @@ 1.8.5 - - 25.2.5 - - - 25.2.5 - - - 25.2.5 - 3.1.1.2 @@ -1245,9 +1236,6 @@ - - - IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Aedifica\Aedifica.OptimizerR32.exe diff --git a/EgtBEAMWALL.Optimizer/ForcedStrategyPanel/ForcedStrategyPanelVM.vb b/EgtBEAMWALL.Optimizer/ForcedStrategyPanel/ForcedStrategyPanelVM.vb index 8bc95407..3a53bde2 100644 --- a/EgtBEAMWALL.Optimizer/ForcedStrategyPanel/ForcedStrategyPanelVM.vb +++ b/EgtBEAMWALL.Optimizer/ForcedStrategyPanel/ForcedStrategyPanelVM.vb @@ -157,6 +157,21 @@ Public Class ForcedStrategyPanelVM m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList Select JsonAvailableStrategy.Deserialize(ProjectManagerVM.CurrProd.nType, -1)).ToList()) End If + If File.Exists(sAvailableStrategiesFilePath) Then + sReadedFile = File.ReadAllText(sAvailableStrategiesFilePath) + Dim JsonStrategyFeatureList As List(Of JsonAvailableStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonAvailableStrategyFeature))(sReadedFile) + Dim JsonAvailableStrategyFeature As JsonAvailableStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGrp = nGRP AndAlso x.nPrc = nPRC) + If IsNothing(JsonAvailableStrategyFeature) Then Return False + Dim JsonAvailableTopology As JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName) + If IsNothing(JsonAvailableTopology) Then + ' ricavo topologia da feature + FindTopologyFromFeature(nFeatureId, sTopologyName) + JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName) + End If + If IsNothing(JsonAvailableTopology) Then Return False + m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList + Select JsonAvailableStrategy.Deserialize(ProjectManagerVM.CurrProd.nType, -1)).ToList()) + End If ' recupero custom Dim nPartId As Integer = EgtGetParent(EgtGetParent(nFeatureId)) Dim nPartProjId As Integer = 0 @@ -266,7 +281,6 @@ Public Class ForcedStrategyPanelVM End Function Friend Sub ForcedStrategy() - If IsNothing(m_CurrentFeature) Then Return ' cancello precedenti valori Dim sPrecStrategyID As String = "" EgtGetInfo(m_CurrentFeature.nFeatureId, ConstBeam.STRATEGY, sPrecStrategyID) diff --git a/EgtBEAMWALL.Optimizer/GeneralParametersStrategy/GeneralParametersStrategyVM.vb b/EgtBEAMWALL.Optimizer/GeneralParametersStrategy/GeneralParametersStrategyVM.vb index 961739ce..ab25cd26 100644 --- a/EgtBEAMWALL.Optimizer/GeneralParametersStrategy/GeneralParametersStrategyVM.vb +++ b/EgtBEAMWALL.Optimizer/GeneralParametersStrategy/GeneralParametersStrategyVM.vb @@ -489,7 +489,6 @@ Public MustInherit Class ProjectParameters End Select End If End Sub - #End Region ' Methods End Class diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml index dd73396c..00e8b407 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml +++ b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml @@ -2,19 +2,9 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" - xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" - xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" - xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" - xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" - xmlns:dxeh="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal" - xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys" - xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" - xmlns:dxfui="http://schemas.devexpress.com/winfx/2008/xaml/core/filteringui" - xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal" - xmlns:i="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer" xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib" - xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"> + PreviewKeyDown="Root_PreviewKeyDown"> @@ -22,334 +12,110 @@ 0.6 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - - - - + + - - - - - + + + + + - - - - - + + + + + - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb index 7f3b2f69..eec5d44d 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb @@ -1,10 +1,4 @@ -Imports System.IO -Imports System.Reflection -Imports DevExpress.Data -Imports DevExpress.Xpf.Bars -Imports DevExpress.Xpf.Core.Serialization -Imports DevExpress.Xpf.Grid -Imports EgtBEAMWALL.Core +Imports System.Reflection Public Class BTLPartListV @@ -14,145 +8,16 @@ Public Class BTLPartListV Private m_isDraggingSelectionField As FieldInfo Private m_endDraggingMethod As MethodInfo - Private m_sDataGridLayoutPath As String = "" - - Private _lastExpanded As Integer = -1 - Private bSelOnFeature As Boolean = False Sub New() ' This call is required by the designer. InitializeComponent() ' Add any initialization after the InitializeComponent() call. - ' Evita il drag sulla selezione multipla - 'm_isDraggingSelectionField = m_DataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic) - 'm_endDraggingMethod = m_DataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic) - - m_sDataGridLayoutPath = Path.GetDirectoryName(DataGridColumnsIniFile.m_sDataGridColumnsIniFile) & "\DataGridLayoutFile\BTLPart.json" - - For Each Column In BTLPart_GridControl.Columns - Column.[AddHandler](DXSerializer.AllowPropertyEvent, - New AllowPropertyEventHandler(AddressOf OnAllowProperty)) - Next - DXSerializer.AddAllowPropertyHandler(BTLPart_GridControl, AddressOf OnAddAllowProperty) - End Sub - - ' imposto parametri da aggiungere o togliere in Json tabella per i parametri di colonna - Private Sub OnAllowProperty(sender As Object, e As AllowPropertyEventArgs) - If e.DependencyProperty Is GridColumn.AllowResizingProperty Then - e.Allow = True - End If - End Sub - - ' imposto parametri da aggiungere o togliere in Json tabella per i parametri generali - Private Sub OnAddAllowProperty(sender As Object, e As AllowPropertyEventArgs) - If e.Property.Name = "FilterString" Then - e.Allow = False - ElseIf e.Property.Name = "MRUFilters" Then - e.Allow = False - ElseIf e.Property.Name = "MRUFilterList" Then - e.Allow = False - ElseIf e.Property.Name = "GroupSummarySortInfo" Then - e.Allow = False - End If - End Sub - - ' salvataggio del layout colonne - Public Sub SaveBTLPartGridControlLayout() - BTLPart_GridControl.SaveLayoutToJson(m_sDataGridLayoutPath) - End Sub - - Public Sub IsVisibleGroupSummary(bValue As Boolean) - If bValue AndAlso BTLPart_GridControl.GroupSummary.Count = 0 Then - BTLPart_GridControl.GroupSummary.Clear() - Dim PDNGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nPDN", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Count, - .ShowInGroupColumnFooter = "nPDN"} - BTLPart_GridControl.GroupSummary.Add(PDNGroupSummaryItem) - Dim CNTGroupSummaryItem As New GridSummaryItem() With {.FieldName = "sCNT", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "sCNT"} - BTLPart_GridControl.GroupSummary.Add(CNTGroupSummaryItem) - Dim ADDEDGroupSummaryItem As New GridSummaryItem() With {.FieldName = "sADDED", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "sADDED"} - BTLPart_GridControl.GroupSummary.Add(ADDEDGroupSummaryItem) - Dim INPRODGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nINPROD", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "nINPROD"} - BTLPart_GridControl.GroupSummary.Add(INPRODGroupSummaryItem) - Dim DONEGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nDONE", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "nDONE"} - BTLPart_GridControl.GroupSummary.Add(DONEGroupSummaryItem) - End If - BTLPart_TableView.ShowGroupFooters = bValue - End Sub - - Public Sub Me_Loaded() Handles Me.Loaded - ' imposto DataContext m_BTLPartListVM = DataContext - ' imposto riferimento ad action per salvataggio layout tabella - m_BTLPartListVM.refSaveBTLPartGridControlLayout = AddressOf SaveBTLPartGridControlLayout - ' rispristino layout tabella - If Not IsNothing(m_sDataGridLayoutPath) AndAlso File.Exists(m_sDataGridLayoutPath) Then - BTLPart_GridControl.RestoreLayoutFromJson(m_sDataGridLayoutPath) - End If - ' da gestire chiamandolo quando viene aperto un progetto o aggiunto/rimosso un btl, per evitare che ci sia il GroupSummary se c'e' un solo gruppo - IsVisibleGroupSummary(False) - End Sub - - ' customizzazione ContextMenu del GridControl - Private Sub OnShowGridMenu(sender As Object, e As DevExpress.Xpf.Grid.GridMenuEventArgs) - If e.MenuType = GridMenuType.Column Then - ' rimozione bottoni - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupBox}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupColumn}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.ColumnChooser}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFit}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFitColumns}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.FilterEditor}) - - Dim info As GridColumnMenuInfo = CType(e.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - ' aggiunta separatore - Dim separator As BarItemLinkSeparator = New BarItemLinkSeparator() - e.Customizations.Add(separator) - ' aggiunta bottone AllowResize e Auto Fit - Dim AllowResize As BarCheckItem = New BarCheckItem() With {.Content = "Allow Resize", .IsChecked = (BTLPart_TableView.AllowResizing AndAlso (item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default))} - AddHandler AllowResize.CheckedChanged, AddressOf AllowResize_CheckedChanged - e.Customizations.Add(AllowResize) - If item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default Then - Dim FixAuto As BarButtonItem = New BarCheckItem() With {.Content = "Auto Fit"} - AddHandler FixAuto.ItemClick, AddressOf FixAuto_ItemClick - e.Customizations.Add(FixAuto) - End If - End If - End Sub - - ' gestore evento Allow Resize - Private Sub AllowResize_CheckedChanged(sender As Object, e As ItemClickEventArgs) - Dim info As GridColumnMenuInfo = TryCast(BTLPart_TableView.GridMenu.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - If item.AllowResizing = DevExpress.Utils.DefaultBoolean.False Then - item.AllowResizing = DevExpress.Utils.DefaultBoolean.True - Else - item.AllowResizing = DevExpress.Utils.DefaultBoolean.False - End If - End Sub - ' gestore evento Auto Fit - Private Sub FixAuto_ItemClick(sender As Object, e As ItemClickEventArgs) - Dim info As GridColumnMenuInfo = TryCast(BTLPart_TableView.GridMenu.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - item.Width = New GridColumnWidth(1, GridColumnUnitType.Auto) - BTLPart_TableView.UpdateLayout() - item.Width = item.ActualWidth - item.AllowResizing = DevExpress.Utils.DefaultBoolean.False + ' Evita il drag sulla selezione multipla + m_isDraggingSelectionField = m_DataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic) + m_endDraggingMethod = m_DataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic) End Sub Public Sub DataGrid_PreviewMouseMove(sender As Object, e As MouseEventArgs) @@ -162,6 +27,27 @@ Public Class BTLPartListV End If End Sub + Private Sub PartList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + If e.ChangedButton = MouseButton.Left Then + If TypeOf sender Is DataGridRow Then + ' Metto la selezione della feature a false + bSelOnFeature = False + If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count <> 1 Then Return + Dim Row As DataGridRow = DirectCast(sender, DataGridRow) + If TypeOf Row.DataContext IsNot BTLPartVM Then Return + Dim BTLPartVM As BTLPartVM = DirectCast(Row.DataContext, BTLPartVM) + Dim DataGridDetailsPresenter As Object = TreeHelperManager.FindVisualParents(Of Button, CheckBox, Primitives.DataGridDetailsPresenter)(e.OriginalSource) + If Not IsNothing(DataGridDetailsPresenter) Then Return + If Map.refProjectVM.BTLStructureVM.SelBTLParts.Contains(BTLPartVM) Then + BTLPartVM.SetOpenFeatureList(Not BTLPartVM.bOpenFeatureList) + End If + If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLPart.Equals(BTLPartVM) Then + Map.refProjectVM.BTLStructureVM.SelectBTLPart(BTLPartVM, True) + End If + End If + End If + End Sub + Private Sub ListBox_PreviewMouseWheel(ByVal sender As Object, ByVal e As MouseWheelEventArgs) ' gestione dello scroll, per permetterlo anche quando mouse su RowDetails e.Handled = True @@ -220,62 +106,31 @@ Public Class BTLPartListV Return Nothing End Function - Private Sub FilterAllBtn_PreviewMouseDown(sender As Object, e As RoutedEventArgs) - If FilterSectxMat_Popup.IsOpen Then - FilterSectxMat_Popup.IsOpen = False - e.Handled = True - End If - End Sub + Private Sub Root_PreviewKeyDown(sender As Object, e As KeyEventArgs) + If e.Key <> Key.Delete Then Return - Private Sub FilterAllBtn_Click(sender As Object, e As RoutedEventArgs) - If Not FilterSectxMat_Popup.IsOpen Then - FilterSectxMat_Popup.IsOpen = True - End If - End Sub - - Private Sub GridControl_MasterRowExpanding(sender As Object, e As DevExpress.Xpf.Grid.RowAllowEventArgs) - Dim grid = CType(sender, DevExpress.Xpf.Grid.GridControl) - - ' Chiudi solo il precedente - If _lastExpanded <> -1 AndAlso _lastExpanded <> e.RowHandle Then - grid.SetMasterRowExpanded(_lastExpanded, False) - End If - - _lastExpanded = e.RowHandle - End Sub - - Private Sub BTLPart_TableView_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) - bSelOnFeature = False - End Sub - - Private Sub ListBox_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) - bSelOnFeature = True - End Sub - - Public Sub HandleDelete(e As KeyEventArgs) Dim BTLStructureVM As BTLStructureVM = TryCast(Me.Tag, BTLStructureVM) If IsNothing(BTLStructureVM) Then Return - Dim SelBTLPart As BTLPartVM = BTLStructureVM.SelBTLPart - Dim SelBTLFeatureVM As BTLFeatureVM = SelBTLPart?.SelBTLFeatureVM + Dim BTLPartVM As BTLPartVM = BTLStructureVM.SelBTLPart + Dim BTLFeatureVM As BTLFeatureVM = BTLPartVM?.SelBTLFeatureVM - If bSelOnFeature AndAlso Not IsNothing(SelBTLFeatureVM) Then - If SelBTLFeatureVM.DeleteFeature_Command.CanExecute(Nothing) Then - SelBTLFeatureVM.DeleteFeature_Command.Execute(Nothing) + If bSelOnFeature AndAlso Not IsNothing(BTLFeatureVM) Then + If Not IsNothing(BTLFeatureVM.DeleteFeature_Command) AndAlso BTLFeatureVM.DeleteFeature_Command.CanExecute(Nothing) Then + BTLFeatureVM.DeleteFeature_Command.Execute(Nothing) e.Handled = True End If Return End If - If BTLStructureVM.DeletePart_Command.CanExecute(Nothing) Then + If Not IsNothing(BTLStructureVM.DeletePart_Command) AndAlso BTLStructureVM.DeletePart_Command.CanExecute(Nothing) Then BTLStructureVM.DeletePart_Command.Execute(Nothing) e.Handled = True End If - End Sub - Private Sub BTLPart_GridControl_CurrentItemChanged(sender As Object, e As CurrentItemChangedEventArgs) - CType(e.Source, GridControl).View.FocusedRowHandle = -1 + Private Sub ListBox_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + bSelOnFeature = True End Sub End Class diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListVM.vb b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListVM.vb index 8e6375da..d5916cd4 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListVM.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListVM.vb @@ -9,8 +9,6 @@ Public Class BTLPartListVM #Region "FIELDS & PROPERTIES" - Friend refSaveBTLPartGridControlLayout As Action - Private m_colPart_Do As EgwWPFBaseLib.ColumnLayout Public ReadOnly Property colPart_Do As EgwWPFBaseLib.ColumnLayout Get @@ -65,17 +63,6 @@ Public Class BTLPartListVM End Set End Property - Private m_CALCPanel_IsEnabled As Boolean = True - Public ReadOnly Property CALCPanel_IsEnabled As Boolean - Get - Return m_CALCPanel_IsEnabled - End Get - End Property - Friend Sub SetCALCPanel_IsEnabled(value As Boolean) - m_CALCPanel_IsEnabled = value - NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled)) - End Sub - #Region "Messages" Public ReadOnly Property PDN_Msg As String @@ -200,11 +187,6 @@ Public Class BTLPartListVM #End Region ' Messages - ' Definizione comandi - Private m_cmdVerifyAll As ICommand - Private m_cmdVerifyFlipRotAll As ICommand - Private m_cmdResetCalc As ICommand - #End Region ' Fields & Properties #Region "CONSTRUCTOR" @@ -225,90 +207,6 @@ Public Class BTLPartListVM #End Region ' Constructor - Friend Sub Close() - If Not IsNothing(refSaveBTLPartGridControlLayout) Then - refSaveBTLPartGridControlLayout() - End If - End Sub - -#Region "COMMANDS" - -#Region "VerifyAll" - - Public ReadOnly Property VerifyAll_Command As ICommand - Get - If m_cmdVerifyAll Is Nothing Then - m_cmdVerifyAll = New Command(AddressOf VerifyAll) - End If - Return m_cmdVerifyAll - End Get - End Property - - Friend Sub VerifyAll() - If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return - ' imposto flag per calcolo - Map.refCALCPanelVM.SetCalculating(True) - For Each BTLPartItem As BTLPartVM In Map.refProjectVM.BTLStructureVM.BTLPartVMList - BTLPartItem.SetIsRowEnabled(False) - Next - Map.refCALCPanelVM.VerifyAll(ProjectType.PROJ, CalcIntegration.CmdTypes.CHECKNOSIM) - Return - End Sub - -#End Region ' VerifyAll - -#Region "VerifyAllFlipRot" - - Public ReadOnly Property VerifyAllFlipRot_Command As ICommand - Get - If m_cmdVerifyFlipRotAll Is Nothing Then - m_cmdVerifyFlipRotAll = New Command(AddressOf VerifyAllFlipRot) - End If - Return m_cmdVerifyFlipRotAll - End Get - End Property - - Friend Sub VerifyAllFlipRot() - If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return - ' imposto flag per calcolo - Map.refCALCPanelVM.SetCalculating(True) - For Each BTLPartItem As BTLPartVM In Map.refProjectVM.BTLStructureVM.BTLPartVMList - BTLPartItem.SetIsRowEnabled(False) - Next - Map.refCALCPanelVM.VerifyAll(ProjectType.PROJ, CalcIntegration.CmdTypes.FLIP_ROT) - Return - End Sub - -#End Region ' VerifyAllRotate - -#Region "ResetCalc" - - Public ReadOnly Property ResetCalc_Command As ICommand - Get - If m_cmdResetCalc Is Nothing Then - m_cmdResetCalc = New Command(AddressOf ResetCalc) - End If - Return m_cmdResetCalc - End Get - End Property - - Public Sub ResetCalc() - If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return - Map.refShowBeamPanelVM.ShowBuilding_IsEnabled = True - Map.refCALCPanelVM.SetCalculating(False) - For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList - If Part.nGlobalState <> CalcStates.NOTCALCULATED Then - ' resetto stato dei calcoli - Part.ResetCalcTotalPart() - End If - If Not Part.IsRowEnabled Then Part.SetIsRowEnabled(True) - Next - End Sub - -#End Region ' ResetCalc - -#End Region ' COMMANDS - End Class Class DataGridCellBorderThicknessConverter @@ -342,7 +240,7 @@ Class ProjIdToBtlFileName Implements IValueConverter Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert - If TypeOf value IsNot String Then Return "" + If TypeOf value IsNot Integer Then Return "" Dim nProjId As Integer = CInt(value) Dim ProjModel As EgtBEAMWALL.DataLayer.DatabaseModels.ProjModel = DbControllers.m_ProjController.FindByProjId(nProjId) If IsNothing(ProjModel) Then Return "" diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml index 41ff5584..ce9c9802 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml +++ b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml @@ -2,107 +2,110 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer" - xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib" - xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" - xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" - xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" - xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" - xmlns:dxeh="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal" - xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys" - xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" - xmlns:dxfui="http://schemas.devexpress.com/winfx/2008/xaml/core/filteringui" - xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal" - xmlns:i="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"> + xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb index 5aedaff0..2a9b46da 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb @@ -1,118 +1,7 @@ -Imports System.IO -Imports DevExpress.Xpf.Bars -Imports DevExpress.Xpf.Core.Serialization -Imports DevExpress.Xpf.Grid -Imports EgtBEAMWALL.Core +Imports EgtBEAMWALL.Core Public Class FeatureInPartInRawPartListV - Private m_FeatureInPartInRawPartListVM As FeatureInPartInRawPartListVM - Private m_sDataGridLayoutPath As String = "" - - Sub New() - - ' This call is required by the designer. - InitializeComponent() - - ' Add any initialization after the InitializeComponent() call. - m_sDataGridLayoutPath = Path.GetDirectoryName(DataGridColumnsIniFile.m_sDataGridColumnsIniFile) & "\DataGridLayoutFile\FeatureInPartInRawPart.json" - - For Each Column In FeatureVMList_GridControl.Columns - Column.[AddHandler](DXSerializer.AllowPropertyEvent, - New AllowPropertyEventHandler(AddressOf OnAllowProperty)) - Next - - FeatureVMList_GridControl.Columns("sPriority").Visible = False - - DXSerializer.AddAllowPropertyHandler(FeatureVMList_GridControl, AddressOf OnAddAllowProperty) - End Sub - - ' imposto parametri da aggiungere o togliere in Json tabella per i parametri di colonna - Private Sub OnAllowProperty(sender As Object, e As AllowPropertyEventArgs) - If e.DependencyProperty Is GridColumn.AllowResizingProperty Then - e.Allow = True - End If - End Sub - - ' imposto parametri da aggiungere o togliere in Json tabella per i parametri generali - Private Sub OnAddAllowProperty(sender As Object, e As AllowPropertyEventArgs) - If e.Property.Name = "FilterString" Then - e.Allow = False - ElseIf e.Property.Name = "MRUFilters" Then - e.Allow = False - ElseIf e.Property.Name = "MRUFilterList" Then - e.Allow = False - ElseIf e.Property.Name = "GroupSummarySortInfo" Then - e.Allow = False - End If - End Sub - - ' salvataggio del layout colonne - Public Sub SaveStatisticGridControlLayout() - FeatureVMList_GridControl.SaveLayoutToJson(m_sDataGridLayoutPath) - End Sub - - Public Sub Me_Loaded() Handles Me.Loaded - ' imposto DataContext - m_FeatureInPartInRawPartListVM = Me.DataContext - ' imposto riferimento ad action per salvataggio layout tabella - m_FeatureInPartInRawPartListVM.refFeatureInPartInRawPartListGridControlLayout = AddressOf SaveStatisticGridControlLayout - ' rispristino layout tabella - If Not IsNothing(m_sDataGridLayoutPath) AndAlso File.Exists(m_sDataGridLayoutPath) Then - FeatureVMList_GridControl.RestoreLayoutFromJson(m_sDataGridLayoutPath) - End If - ' da gestire chiamandolo quando viene aperto un progetto o aggiunto/rimosso un btl, per evitare che ci sia il GroupSummary se c'e' un solo gruppo - FeatureVMList_TableView.ShowGroupFooters = False - End Sub - - Private Sub OnShowGridMenu(sender As Object, e As DevExpress.Xpf.Grid.GridMenuEventArgs) - If e.MenuType = GridMenuType.Column Then - ' rimozione bottoni - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupBox}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupColumn}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.ColumnChooser}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFit}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFitColumns}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.FilterEditor}) - - Dim info As GridColumnMenuInfo = CType(e.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - ' aggiunta separatore - Dim separator As BarItemLinkSeparator = New BarItemLinkSeparator() - e.Customizations.Add(separator) - ' aggiunta bottone AllowResize e Auto Fit - Dim AllowResize As BarCheckItem = New BarCheckItem() With {.Content = "Allow Resize", .IsChecked = (FeatureVMList_TableView.AllowResizing AndAlso (item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default))} - AddHandler AllowResize.CheckedChanged, AddressOf AllowResize_CheckedChanged - e.Customizations.Add(AllowResize) - If item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default Then - Dim FixAuto As BarButtonItem = New BarCheckItem() With {.Content = "Auto Fit"} - AddHandler FixAuto.ItemClick, AddressOf FixAuto_ItemClick - e.Customizations.Add(FixAuto) - End If - End If - End Sub - - ' gestore evento Allow Resize - Private Sub AllowResize_CheckedChanged(sender As Object, e As ItemClickEventArgs) - Dim info As GridColumnMenuInfo = TryCast(FeatureVMList_TableView.GridMenu.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - If item.AllowResizing = DevExpress.Utils.DefaultBoolean.False Then - item.AllowResizing = DevExpress.Utils.DefaultBoolean.True - Else - item.AllowResizing = DevExpress.Utils.DefaultBoolean.False - End If - End Sub - - ' gestore evento Auto Fit - Private Sub FixAuto_ItemClick(sender As Object, e As ItemClickEventArgs) - Dim info As GridColumnMenuInfo = TryCast(FeatureVMList_TableView.GridMenu.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - item.Width = New GridColumnWidth(1, GridColumnUnitType.Auto) - FeatureVMList_TableView.UpdateLayout() - item.Width = item.ActualWidth - item.AllowResizing = DevExpress.Utils.DefaultBoolean.False - End Sub - ' 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 diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListVM.vb b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListVM.vb index bc7a1730..ad13c556 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListVM.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListVM.vb @@ -8,8 +8,6 @@ Public Class FeatureInPartInRawPartListVM #Region "FIELDS & PROPERTIES" - Public refFeatureInPartInRawPartListGridControlLayout As Action - Private m_colFeatureInPartInRawPart_Do As EgwWPFBaseLib.ColumnLayout Public ReadOnly Property colFeatureInPartInRawPart_Do As EgwWPFBaseLib.ColumnLayout Get diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/PParameterListV.xaml b/EgtBEAMWALL.Optimizer/ItemParamList/PParameterListV.xaml index a855cb64..5302a5dc 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/PParameterListV.xaml +++ b/EgtBEAMWALL.Optimizer/ItemParamList/PParameterListV.xaml @@ -2,22 +2,9 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer" - xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib" - xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" - xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" - xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" - xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" - xmlns:dxeh="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal" - xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys" - xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" - xmlns:dxfui="http://schemas.devexpress.com/winfx/2008/xaml/core/filteringui" - xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal" - xmlns:i="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"> + xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"> - - - - + @@ -26,66 +13,118 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -271,11 +65,11 @@ + Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}" + Background="{Binding Calc_Background}"/> @@ -283,163 +77,503 @@ + Text="{Binding CALC_ERR_Letter}" + Foreground="{Binding CALC_ERR_Foreground}" + Style="{StaticResource FeatureInPartInRawPartList_TextBlock}"/> - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml.vb b/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml.vb index ac2e0c01..ecf98a42 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml.vb @@ -1,111 +1,8 @@ -Imports System.IO -Imports DevExpress.Data -Imports DevExpress.Xpf.Bars -Imports DevExpress.Xpf.Core.Serialization -Imports DevExpress.Xpf.Grid -Imports EgtBEAMWALL.Core +Imports EgtBEAMWALL.Core Imports EgtUILib.EgtInterface Public Class RawPartListV - Private m_RawPartListVM As RawPartListVM - - Private m_sDataGridLayoutPath As String = "" - - Private _lastExpanded As Integer = -1 - - Sub New() - - ' This call is required by the designer. - InitializeComponent() - - ' Add any initialization after the InitializeComponent() call. - m_sDataGridLayoutPath = Path.GetDirectoryName(DataGridColumnsIniFile.m_sDataGridColumnsIniFile) & "\DataGridLayoutFile\RawPart.json" - - For Each Column In RawPart_GridControl.Columns - Column.[AddHandler](DXSerializer.AllowPropertyEvent, - New AllowPropertyEventHandler(AddressOf OnAllowProperty)) - Next - For Each Column In Part_GridControl.Columns - Column.[AddHandler](DXSerializer.AllowPropertyEvent, - New AllowPropertyEventHandler(AddressOf OnAllowProperty)) - Next - DXSerializer.AddAllowPropertyHandler(RawPart_GridControl, AddressOf OnAddAllowProperty) - DXSerializer.AddAllowPropertyHandler(Part_GridControl, AddressOf OnAddAllowProperty) - - RawPart_GridControl.Columns("sPosZ").Visible = False - End Sub - - ' imposto parametri da aggiungere o togliere in Json tabella per i parametri di colonna - Private Sub OnAllowProperty(sender As Object, e As AllowPropertyEventArgs) - If e.DependencyProperty Is GridColumn.AllowResizingProperty Then - e.Allow = True - End If - End Sub - - ' imposto parametri da aggiungere o togliere in Json tabella per i parametri generali - Private Sub OnAddAllowProperty(sender As Object, e As AllowPropertyEventArgs) - If e.Property.Name = "FilterString" Then - e.Allow = False - ElseIf e.Property.Name = "MRUFilters" Then - e.Allow = False - ElseIf e.Property.Name = "MRUFilterList" Then - e.Allow = False - ElseIf e.Property.Name = "GroupSummarySortInfo" Then - e.Allow = False - End If - End Sub - - ' salvataggio del layout colonne - Public Sub SaveBTLPartGridControlLayout() - RawPart_GridControl.SaveLayoutToJson(m_sDataGridLayoutPath) - End Sub - - Public Sub Me_Loaded() Handles Me.Loaded - ' imposto DataContext - m_RawPartListVM = DataContext - ' imposto riferimento ad action per salvataggio layout tabella - m_RawPartListVM.refSaveBTLPartGridControlLayout = AddressOf SaveBTLPartGridControlLayout - ' rispristino layout tabella - If Not IsNothing(m_sDataGridLayoutPath) AndAlso File.Exists(m_sDataGridLayoutPath) Then - RawPart_GridControl.RestoreLayoutFromJson(m_sDataGridLayoutPath) - End If - ' da gestire chiamandolo quando viene aperto un progetto o aggiunto/rimosso un btl, per evitare che ci sia il GroupSummary se c'e' un solo gruppo - IsVisibleGroupSummary(False) - End Sub - - Public Sub IsVisibleGroupSummary(bValue As Boolean) - If bValue AndAlso RawPart_GridControl.GroupSummary.Count = 0 Then - RawPart_GridControl.GroupSummary.Clear() - Dim PDNGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nPDN", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Count, - .ShowInGroupColumnFooter = "nPDN"} - RawPart_GridControl.GroupSummary.Add(PDNGroupSummaryItem) - Dim CNTGroupSummaryItem As New GridSummaryItem() With {.FieldName = "sCNT", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "sCNT"} - RawPart_GridControl.GroupSummary.Add(CNTGroupSummaryItem) - Dim ADDEDGroupSummaryItem As New GridSummaryItem() With {.FieldName = "sADDED", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "sADDED"} - RawPart_GridControl.GroupSummary.Add(ADDEDGroupSummaryItem) - Dim INPRODGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nINPROD", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "nINPROD"} - RawPart_GridControl.GroupSummary.Add(INPRODGroupSummaryItem) - Dim DONEGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nDONE", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "nDONE"} - RawPart_GridControl.GroupSummary.Add(DONEGroupSummaryItem) - End If - RawPart_TableView.ShowGroupFooters = bValue - End Sub - ' funzione che permette di selezionare un RawPart anche quando gia' selezionato Private Sub RawPartRow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Map.refProjectVM.BTLStructureVM.SelBTLPart.SetOpenFeatureList(False) @@ -141,13 +38,13 @@ Public Class RawPartListV parent = VisualTreeHelper.GetParent(parent) End While - 'If parent IsNot Nothing Then - ' Dim popup As New RawPartListPopUpV() - ' If Not IsNothing(popup) Then - ' popup.PlacementTarget = btn ' Associa il popup al bottone - ' popup.IsOpen = True ' Mostra il popup - ' End If - 'End If + If parent IsNot Nothing Then + Dim popup As New RawPartListPopUpV() + If Not IsNothing(popup) Then + popup.PlacementTarget = btn ' Associa il popup al bottone + popup.IsOpen = True ' Mostra il popup + End If + End If End Sub ' funzione che permette di selezionare un pezzo anche quando gia' selezionato @@ -184,87 +81,4 @@ Public Class RawPartListV .Source = sender}) End Sub - ' customizzazione ContextMenu del GridControl - Private Sub OnShowGridMenu(sender As Object, e As DevExpress.Xpf.Grid.GridMenuEventArgs) - If e.MenuType = GridMenuType.Column Then - ' rimozione bottoni - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupBox}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupColumn}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.ColumnChooser}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFit}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFitColumns}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.FilterEditor}) - - Dim info As GridColumnMenuInfo = CType(e.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - ' aggiunta separatore - Dim separator As BarItemLinkSeparator = New BarItemLinkSeparator() - e.Customizations.Add(separator) - ' aggiunta bottone AllowResize e Auto Fit - Dim AllowResize As BarCheckItem = New BarCheckItem() With {.Content = "Allow Resize", .IsChecked = (RawPart_TableView.AllowResizing AndAlso (item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default))} - AddHandler AllowResize.CheckedChanged, AddressOf AllowResize_CheckedChanged - e.Customizations.Add(AllowResize) - If item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default Then - Dim FixAuto As BarButtonItem = New BarCheckItem() With {.Content = "Auto Fit"} - AddHandler FixAuto.ItemClick, AddressOf FixAuto_ItemClick - e.Customizations.Add(FixAuto) - End If - End If - End Sub - - ' gestore evento Allow Resize - Private Sub AllowResize_CheckedChanged(sender As Object, e As ItemClickEventArgs) - Dim info As GridColumnMenuInfo = TryCast(e.Link.DataContext, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - If item.AllowResizing = DevExpress.Utils.DefaultBoolean.False Then - item.AllowResizing = DevExpress.Utils.DefaultBoolean.True - Else - item.AllowResizing = DevExpress.Utils.DefaultBoolean.False - End If - End Sub - - ' gestore evento Auto Fit - Private Sub FixAuto_ItemClick(sender As Object, e As ItemClickEventArgs) - Dim info As GridColumnMenuInfo = TryCast(e.Link.DataContext, GridColumnMenuInfo) - If IsNothing(info) Then Return - Dim item As ColumnBase = CType(info.Column, ColumnBase) - item.Width = New GridColumnWidth(1, GridColumnUnitType.Auto) - RawPart_TableView.UpdateLayout() - item.Width = item.ActualWidth - item.AllowResizing = DevExpress.Utils.DefaultBoolean.False - End Sub - - Private Sub GridControl_MasterRowExpanding(sender As Object, e As DevExpress.Xpf.Grid.RowAllowEventArgs) - Dim grid = CType(sender, DevExpress.Xpf.Grid.GridControl) - - ' Chiudi solo il precedente - If _lastExpanded <> -1 AndAlso _lastExpanded <> e.RowHandle Then - grid.SetMasterRowExpanded(_lastExpanded, False) - End If - - _lastExpanded = e.RowHandle - End Sub - - Private Sub RawPart_GridControl_MasterRowExpanded(sender As Object, e As RowEventArgs) - Dim masterGrid As GridControl = TryCast(sender, GridControl) - - If masterGrid IsNot Nothing Then - Dim detailGrid As GridControl = TryCast(masterGrid.GetDetail(e.RowHandle, masterGrid.DetailDescriptor), GridControl) - - If Not IsNothing(detailGrid) Then - If Not IsNothing(detailGrid) Then - Dim colPosX As GridColumn = detailGrid.Columns("sPOSX") - If Not IsNothing(colPosX) Then colPosX.Visible = False - - Dim colPosY As GridColumn = detailGrid.Columns("sPOSY") - If Not IsNothing(colPosY) Then colPosY.Visible = False - - Dim colMat As GridColumn = detailGrid.Columns("sMATERIAL") - If Not IsNothing(colMat) Then colMat.Visible = False - End If - - End If - End If - End Sub - End Class diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListVM.vb b/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListVM.vb index c23f09a0..00a4ef1d 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListVM.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListVM.vb @@ -8,8 +8,6 @@ Public Class RawPartListVM #Region "FIELDS & PROPERTIES" - Friend refSaveBTLPartGridControlLayout As Action - Private m_colRawPart_StartCut As EgwWPFBaseLib.ColumnLayout Public ReadOnly Property colRawPart_StartCut As EgwWPFBaseLib.ColumnLayout Get @@ -250,12 +248,6 @@ Public Class RawPartListVM m_colPartInRawPart_PosY = PartInRawPartColumns.FirstOrDefault(Function(x) x.Key = COL_POSY) End Sub - Friend Sub Close() - If Not IsNothing(refSaveBTLPartGridControlLayout) Then - refSaveBTLPartGridControlLayout() - End If - End Sub - #End Region ' Methods End Class diff --git a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml index 05ef648d..0fa30927 100644 --- a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml +++ b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml @@ -2,7 +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:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer" Style="{StaticResource LeftPanel_Grid}"> @@ -18,8 +17,132 @@ Grid.ColumnSpan="2" Style="{StaticResource Optimizer_Border}"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml.vb b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml.vb index 6a4b9662..919aa0c7 100644 --- a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml.vb @@ -1,7 +1,3 @@ Public Class LeftPanelV - Public Sub ForwardDelete(e As KeyEventArgs) - PartList.HandleDelete(e) - End Sub - End Class diff --git a/EgtBEAMWALL.Optimizer/MachGroupPanel/MyMachGroupPanelVM.vb b/EgtBEAMWALL.Optimizer/MachGroupPanel/MyMachGroupPanelVM.vb index 4162bb94..75c0c36e 100644 --- a/EgtBEAMWALL.Optimizer/MachGroupPanel/MyMachGroupPanelVM.vb +++ b/EgtBEAMWALL.Optimizer/MachGroupPanel/MyMachGroupPanelVM.vb @@ -7,7 +7,6 @@ Public Class MyMachGroupPanelVM #Region "FIELDS & PROPERTIES" - Public Property m_OldSelectedMachGroup As MyMachGroupVM Public Shadows Property SelectedMachGroup As MyMachGroupVM Get Return m_SelectedMachGroup @@ -30,13 +29,7 @@ Public Class MyMachGroupPanelVM Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound() Next End If - - If Not IsNothing(value) Then m_OldSelectedMachGroup = value - m_SelectedMachGroup = value - - If IsNothing(m_SelectedMachGroup) Then m_SelectedMachGroup = m_OldSelectedMachGroup - If Not IsNothing(value) Then OnPreSetCurrMachGroup() EgtSetCurrMachGroup(value.Id) diff --git a/EgtBEAMWALL.Optimizer/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.Optimizer/MachGroupPanel/PartVM.vb index 84fdb2ca..b9c90940 100644 --- a/EgtBEAMWALL.Optimizer/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.Optimizer/MachGroupPanel/PartVM.vb @@ -240,7 +240,7 @@ Public Class PartVM End If End If End If - EgtSetCurrMachGroup(ParentMachGroupVM.Id) + EgtSetCurrMachGroup(Map.refMachGroupPanelVM.SelectedMachGroup.Id) ' lo riseleziono EgtSelectObj(nPartId) ' resetto validazione del pezzo @@ -484,7 +484,7 @@ Public Class PartVM ' reinserisco il pezzo nel grezzo EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId) End If - EgtSetCurrMachGroup(ParentMachGroupVM.Id) + EgtSetCurrMachGroup(Map.refMachGroupPanelVM.SelectedMachGroup.Id) ' lo riseleziono EgtSelectObj(nPartId) ' resetto validazione del pezzo @@ -738,7 +738,7 @@ Public Class PartVM If IsNothing(ProjectManagerVM.CurrProd) Then Return Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup ' Recupero indice elemento selezionato in lista - Dim Index As Integer = ParentMachGroupVM.PartVMList.IndexOf(ParentMachGroupVM.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)) + Dim Index As Integer = ParentMachGroupVM.PartVMList.IndexOf(SelMachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)) If IsNothing(SelMachGroup) Then Return ' se barra gia' assegnata a supervisore, esco If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return @@ -769,16 +769,17 @@ Public Class PartVM Public Sub RemovePart() If IsNothing(ProjectManagerVM.CurrProd) Then Return If EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62575), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then - If IsNothing(ParentMachGroupVM) Then Return + Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup ' Recupero indice elemento selezionato in lista - Dim Index As Integer = ParentMachGroupVM.PartVMList.IndexOf(ParentMachGroupVM.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)) + Dim Index As Integer = ParentMachGroupVM.PartVMList.IndexOf(SelMachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)) + If IsNothing(SelMachGroup) Then Return ' se barra gia' assegnata a supervisore, esco - If ParentMachGroupVM.nProduction_State >= ItemState.Assigned Then Return - Dim SelPart As PartVM = ParentMachGroupVM.PartVMList(Index) + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return + Dim SelPart As PartVM = SelMachGroup.PartVMList(Index) If IsNothing(SelPart) Then Return SelPart.DeletePart() - ParentMachGroupVM.UpdateUsage() - ParentMachGroupVM.ResetCalcMachGroup() + SelMachGroup.UpdateUsage() + SelMachGroup.ResetCalcMachGroup() Else Return End If diff --git a/EgtBEAMWALL.Optimizer/MachinePanel/MachinePanelV.xaml b/EgtBEAMWALL.Optimizer/MachinePanel/MachinePanelV.xaml index a3d10fb5..087f2828 100644 --- a/EgtBEAMWALL.Optimizer/MachinePanel/MachinePanelV.xaml +++ b/EgtBEAMWALL.Optimizer/MachinePanel/MachinePanelV.xaml @@ -88,7 +88,9 @@ - + + + diff --git a/EgtBEAMWALL.Optimizer/MainMenu/MainMenuVM.vb b/EgtBEAMWALL.Optimizer/MainMenu/MainMenuVM.vb index 5189deb2..42804d52 100644 --- a/EgtBEAMWALL.Optimizer/MainMenu/MainMenuVM.vb +++ b/EgtBEAMWALL.Optimizer/MainMenu/MainMenuVM.vb @@ -641,7 +641,7 @@ Public Class MainMenuVM Dim bEx As Boolean = False Try Dim sAddressArray As String() = sSupportAddress.Split(CType(",", Char())) - Dim SendFeedbackWindow As New EgtWPFLib5.MapiMailMessage("AEdifica Feedback - " & sKey) + Dim SendFeedbackWindow As New EgtWPFLib5.MapiMailMessage("Aedifica Feedback - " & sKey) SendFeedbackWindow.Recipients.Add(sAddressArray(0)) For index As Integer = 1 To sAddressArray.Length() - 1 SendFeedbackWindow.Recipients.Add(sAddressArray(index), EgtWPFLib5.MapiMailMessage.RecipientType.CC) diff --git a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml index c6a4030a..4822daa3 100644 --- a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml +++ b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml @@ -26,7 +26,7 @@ - + diff --git a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb index e51b4498..2dd746a6 100644 --- a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb @@ -22,20 +22,12 @@ Public Class MainWindowV Me.SetPlacementAppName(S_GENERAL) Me.SetPlacementKeyName(K_WINPLACE) Me.SetPlacementFileName(IniFile.m_sIniFile) - - Me.AddHandler(Keyboard.KeyDownEvent, New KeyEventHandler(AddressOf Global_KeyDown), True) End Sub #End Region ' CONSTRUCTOR #Region "EVENTS" - Private Sub Global_KeyDown(sender As Object, e As KeyEventArgs) - If e.Key = Key.Delete Then - ProjectView.ForwardDelete(e) - End If - End Sub - Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) ' Carico e imposto posizione finestra WinPosFromIniToWindow(S_GENERAL, K_VIEWOPTIMWINPLACE, Me) diff --git a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowVM.vb index 7ea4f24c..8d8c900a 100644 --- a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowVM.vb @@ -430,9 +430,6 @@ Public Class MainWindowVM {S_FEATUREINPARTINRAWPARTLIST, Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns}, {S_PARAMETERLIST_P, Map.refPParameterListVM.PParameterListColumns}} EgwWPFBaseLib.EgwDataGrid.WriteColumnLayout(DataGridColumnsIniFile.m_sDataGridColumnsIniFile, DataGridColumnDictionary) - Map.refPartListVM.Close() - Map.refRawPartListVM.Close() - End If ' Termino il Model m_MainWindowM.Close() diff --git a/EgtBEAMWALL.Optimizer/Panel/LeftPanelBottomV.xaml b/EgtBEAMWALL.Optimizer/Panel/LeftPanelBottomV.xaml index f93bbad1..70c2cd12 100644 --- a/EgtBEAMWALL.Optimizer/Panel/LeftPanelBottomV.xaml +++ b/EgtBEAMWALL.Optimizer/Panel/LeftPanelBottomV.xaml @@ -16,7 +16,8 @@ Style="{StaticResource Bottom_WrapPanel}"> - + diff --git a/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml b/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml index 5017063d..48480bac 100644 --- a/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml +++ b/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml @@ -7,8 +7,9 @@ - diff --git a/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml.vb b/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml.vb index 99bd386b..31d1f74a 100644 --- a/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml.vb @@ -1,7 +1,3 @@ Public Class LeftPanelTopV - Public Sub ForwardDelete(e As KeyEventArgs) - LeftPanel.ForwardDelete(e) - End Sub - End Class diff --git a/EgtBEAMWALL.Optimizer/Panel/RightPanelBottomV.xaml b/EgtBEAMWALL.Optimizer/Panel/RightPanelBottomV.xaml index 794905c5..651b9a1d 100644 --- a/EgtBEAMWALL.Optimizer/Panel/RightPanelBottomV.xaml +++ b/EgtBEAMWALL.Optimizer/Panel/RightPanelBottomV.xaml @@ -25,8 +25,8 @@ Style="{StaticResource Optimizer_Border}" Visibility="{Binding DataContext.FeatureList_Visibility, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:RightPanelBottomV}}}"/> + Tag="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:RightPanelBottomV}}}" + Visibility="{Binding DataContext.FeatureList_Visibility, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:RightPanelBottomV}}}"/> - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb b/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb index ce194832..b1c7bdc2 100644 --- a/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb +++ b/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb @@ -4,6 +4,7 @@ Imports System.IO.Compression Imports System.Windows.Threading Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.DataLayer.DatabaseModels +Imports EgtBEAMWALL.Optimizer.MainMenuVM Imports EgtUILib Imports EgtWPFLib5 Imports Newtonsoft.Json @@ -995,15 +996,6 @@ Public Class ProdManagerVM ' Apro finestra parametri generali Dim GeneralParametersWndVM As New GeneralParametersWndVM(nType) - - ' Controllo se la cartella AiSetUp è presente - GetFirstAiSetUp(nType) - - Dim sDefaultConfigFile As String = String.Empty - If EgtUILib.GetPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sDefaultConfigFile, Map.refMainWindowVM.MainWindowM.sDefaultConfig) = 0 Then - SetFirstStrategy(GeneralParametersWndVM, sDefaultConfigFile) - End If - GeneralParametersWndVM.SetbSaveGeneralParameters(True) GeneralParametersWndVM.SaveProjectParameters() diff --git a/EgtBEAMWALL.Optimizer/Project/ProjectV.xaml b/EgtBEAMWALL.Optimizer/Project/ProjectV.xaml index 8051d7aa..c8bb442f 100644 --- a/EgtBEAMWALL.Optimizer/Project/ProjectV.xaml +++ b/EgtBEAMWALL.Optimizer/Project/ProjectV.xaml @@ -18,7 +18,7 @@ - + ''' Funzione che permette di eliminare un pezzo modificato e reinserirlo nell'assemblato ''' @@ -543,26 +599,31 @@ Public Class ProjectVM For Each GeneralParameter In m_GeneralParametersList Select Case GeneralParameter.GetType() Case GetType(BooleanGenericParameter) - SetGeneralParameters(False) + SetbSaveGeneralParameters(False) + SetGeneralParametersIsEnable(False) EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge) EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED") Case GetType(DoubleGenericParameter) - SetGeneralParameters(False) + SetbSaveGeneralParameters(False) + SetGeneralParametersIsEnable(False) EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge) EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED") Case GetType(ComboGenericParameter) - SetGeneralParameters(False) + SetbSaveGeneralParameters(False) + SetGeneralParametersIsEnable(False) EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge) EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED") Case GetType(StringGenericParameter) - SetGeneralParameters(False) + SetbSaveGeneralParameters(False) + SetGeneralParametersIsEnable(False) EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge) EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED") Case GetType(ListGenericParameter) For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue If Item.bIsActive Then sInfo &= Item.sUUID & "," & Item.sName & ";" - SetGeneralParameters(False) + SetbSaveGeneralParameters(False) + SetGeneralParametersIsEnable(False) EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge) End If Next @@ -898,12 +959,11 @@ Public Class ProjectVM EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup) End If End Sub - #End Region ' Methods #Region "COMMAND" -#Region "Optimizer_Command" +#Region "Ottimization" Public ReadOnly Property Optimizer_Command As ICommand Get @@ -919,9 +979,9 @@ Public Class ProjectVM StatisticWndV.ShowDialog() End Sub -#End Region ' Optimizer_Command +#End Region ' Ottimization -#Region "Parameter_Command" +#Region "Parameter" Public ReadOnly Property Parameter_Command As ICommand Get @@ -937,7 +997,7 @@ Public Class ProjectVM PartParametersWnd.ShowDialog() End Sub -#End Region ' Parameter_Command +#End Region ' Parameter #Region "Back_Command" @@ -953,7 +1013,6 @@ Public Class ProjectVM Public Sub Back() SetRawPartManagerVisibility(True) If Not IsNothing(m_MachGroupPanelVM) Then Map.refProjectVM.SetFeatureListVisibility(True) - If Not IsNothing(Map.refPParameterListVM) Then Map.refPParameterListVM.refPParameterListGridControlLayout() SetStrategyManagerVisibility(False) SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER) SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER) diff --git a/EgtBEAMWALL.Optimizer/Resources/NewPage/EditIntestazione.png b/EgtBEAMWALL.Optimizer/Resources/NewPage/EditIntestazione.png deleted file mode 100644 index 505864ab..00000000 Binary files a/EgtBEAMWALL.Optimizer/Resources/NewPage/EditIntestazione.png and /dev/null differ diff --git a/EgtBEAMWALL.Optimizer/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.Optimizer/SceneHost/MySceneHostVM.vb index fa6f9a0b..fd133730 100644 --- a/EgtBEAMWALL.Optimizer/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.Optimizer/SceneHost/MySceneHostVM.vb @@ -78,7 +78,7 @@ Public Class MySceneHostVM ' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore" Dim sText As String = EgtMsg(10102) & vbCrLf & EgtMsg(10103) Dim sTitle As String = EgtMsg(10101) - Core.EgtMessageBoxV.Show(Nothing, sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) ' Altrimenti manca la licenza Else EgtOutLog("Problems with Licence") @@ -86,7 +86,7 @@ Public Class MySceneHostVM Dim sKeyInfo As String = "" : EgtGetKeyInfo(sKeyInfo) Dim sText As String = sKeyInfo & vbCrLf & EgtMsg(10105) & vbCrLf & EgtMsg(10106) Dim sTitle As String = EgtMsg(10101) - If Core.EgtMessageBoxV.Show(Nothing, sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then + If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then ' Apro dialogo per richiesta file licenza Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With { .Title = EgtMsg(110026), diff --git a/EgtBEAMWALL.Optimizer/Statistics/OptimizerStatisticsV.xaml b/EgtBEAMWALL.Optimizer/Statistics/OptimizerStatisticsV.xaml index 28dec119..d92e1062 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/OptimizerStatisticsV.xaml +++ b/EgtBEAMWALL.Optimizer/Statistics/OptimizerStatisticsV.xaml @@ -2,17 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer" - xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib" - xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" - xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" - xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" - xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" - xmlns:dxeh="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal" - xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys" - xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" - xmlns:dxfui="http://schemas.devexpress.com/winfx/2008/xaml/core/filteringui" - xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal" - xmlns:i="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"> + xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"> @@ -27,107 +17,163 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"> @@ -147,42 +145,8 @@ Style="{StaticResource PDF_TextBlock}"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/EgtBEAMWALL.Optimizer/Statistics/PDFEditorV.xaml.vb b/EgtBEAMWALL.Optimizer/Statistics/PDFEditorV.xaml.vb index 873833b9..1dded60a 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/PDFEditorV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/Statistics/PDFEditorV.xaml.vb @@ -7,8 +7,6 @@ ' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent(). DataContext = New PDFEditorVM() - - MapV.SetRefPDFEditorV(Me) End Sub End Class diff --git a/EgtBEAMWALL.Optimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.Optimizer/Statistics/PDFEditorVM.vb index faeda687..1378286e 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/PDFEditorVM.vb +++ b/EgtBEAMWALL.Optimizer/Statistics/PDFEditorVM.vb @@ -61,7 +61,6 @@ Public Class PDFEditorVM m_nViewButton = value NotifyPropertyChanged(NameOf(nViewButton)) End Sub - ' Definizione comandi Private m_cmdCreatePDFPreviewVis As ICommand Private m_cmdCreatePDFPreviewOtt As ICommand @@ -125,7 +124,6 @@ Public Class PDFEditorVM SetPdfViewer_Visibility(True) Configuration.CreatePrintPDF(PDFPage.VIEW, True) SetWebAddress(Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf") - MapV.refPDFEditorV.PDFViewer.OpenDocument(WebAddress) End Select End Sub @@ -160,8 +158,7 @@ Public Class PDFEditorVM Case VIEW_BUTTON.PDF SetPdfViewer_Visibility(True) Configuration.CreatePrintPDF(PDFPage.MACHING, True) - SetWebAddress(Map.refMainWindowVM.MainWindowM.sTempDir & "\OptStatistics.pdf") - MapV.refPDFEditorV.PDFViewer.OpenDocument(WebAddress) + SetWebAddress(Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf") End Select End Sub @@ -184,7 +181,6 @@ Public Class PDFEditorVM Public Sub ClosePreview() Try File.Delete(Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf") - File.Delete(Map.refMainWindowVM.MainWindowM.sTempDir & "\OptStatistics.pdf") Catch ex As Exception EgtOutLog("Errore! Cancellazione dei file pdf fallita") End Try diff --git a/EgtBEAMWALL.Optimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.Optimizer/Statistics/PDFHelper.vb index 59e7fdaf..5babcab4 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/PDFHelper.vb +++ b/EgtBEAMWALL.Optimizer/Statistics/PDFHelper.vb @@ -384,6 +384,7 @@ Module PDFHelper Dim paragraph As Paragraph = section.AddParagraph(EgtMsg(62590), "Heading2") paragraph.Format.SpaceAfter = Unit.FromMillimeter(3.0) + ' Controllo se bPreview è true mostra il PDF di preview se no il PDF completo If bPreview Then CreateRawPartPage(section, sMachGroupList, sPDN, sW, sH, sL, sDesc, sMaterial, Nothing, bPreview) Else diff --git a/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml b/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml index d3a123c3..85e97c42 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml +++ b/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml @@ -2,100 +2,148 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer" - xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib" - xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" - xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" - xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" - xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" - xmlns:dxeh="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal" - xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys" - xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" - xmlns:dxfui="http://schemas.devexpress.com/winfx/2008/xaml/core/filteringui" - xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal" - xmlns:i="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"> + xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"> - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml.vb b/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml.vb index a6c882b1..81dbdc35 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml.vb @@ -1,153 +1,10 @@ -Imports DevExpress.Data -Imports DevExpress.Xpf.Bars -Imports DevExpress.Xpf.Core.Serialization -Imports DevExpress.Xpf.Grid -Imports EgtBEAMWALL.Core -Imports System.IO - -Public Class StatisticsV +Public Class StatisticsV Private m_StatisticsVM As StatisticsVM - Private m_sDataGridLayoutPath As String = "" - - Sub New() - - ' This call is required by the designer. - InitializeComponent() - - ' Add any initialization after the InitializeComponent() call. - m_sDataGridLayoutPath = Path.GetDirectoryName(DataGridColumnsIniFile.m_sDataGridColumnsIniFile) & "\DataGridLayoutFile\Statistics.json" - - For Each Column In dgStatistics_GridControl.Columns - Column.[AddHandler](DXSerializer.AllowPropertyEvent, - New AllowPropertyEventHandler(AddressOf OnAllowProperty)) - Next - DXSerializer.AddAllowPropertyHandler(dgStatistics_GridControl, AddressOf OnAddAllowProperty) - - End Sub - - ' imposto parametri da aggiungere o togliere in Json tabella per i parametri di colonna - Private Sub OnAllowProperty(sender As Object, e As AllowPropertyEventArgs) - If e.DependencyProperty Is GridColumn.AllowResizingProperty Then - e.Allow = True - End If - End Sub - - ' imposto parametri da aggiungere o togliere in Json tabella per i parametri generali - Private Sub OnAddAllowProperty(sender As Object, e As AllowPropertyEventArgs) - If e.Property.Name = "FilterString" Then - e.Allow = False - ElseIf e.Property.Name = "MRUFilters" Then - e.Allow = False - ElseIf e.Property.Name = "MRUFilterList" Then - e.Allow = False - ElseIf e.Property.Name = "GroupSummarySortInfo" Then - e.Allow = False - End If - End Sub - - ' salvataggio del layout colonne - Public Sub SaveStatisticGridControlLayout() - dgStatistics_GridControl.SaveLayoutToJson(m_sDataGridLayoutPath) - End Sub - - Public Sub IsVisibleGroupSummary(bValue As Boolean) - If bValue AndAlso dgStatistics_GridControl.GroupSummary.Count = 0 Then - dgStatistics_GridControl.GroupSummary.Clear() - Dim PDNGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nPDN", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Count, - .ShowInGroupColumnFooter = "nPDN"} - dgStatistics_GridControl.GroupSummary.Add(PDNGroupSummaryItem) - Dim CNTGroupSummaryItem As New GridSummaryItem() With {.FieldName = "sCNT", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "sCNT"} - dgStatistics_GridControl.GroupSummary.Add(CNTGroupSummaryItem) - Dim ADDEDGroupSummaryItem As New GridSummaryItem() With {.FieldName = "sADDED", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "sADDED"} - dgStatistics_GridControl.GroupSummary.Add(ADDEDGroupSummaryItem) - Dim INPRODGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nINPROD", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "nINPROD"} - dgStatistics_GridControl.GroupSummary.Add(INPRODGroupSummaryItem) - Dim DONEGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nDONE", - .DisplayFormat = "{0}", - .SummaryType = SummaryItemType.Sum, - .ShowInGroupColumnFooter = "nDONE"} - dgStatistics_GridControl.GroupSummary.Add(DONEGroupSummaryItem) - End If - dgStatistics_TableView.ShowGroupFooters = bValue - End Sub - - Public Sub Me_Loaded() Handles Me.Loaded - ' imposto DataContext - m_StatisticsVM = Me.DataContext - ' imposto riferimento ad action per salvataggio layout tabella - m_StatisticsVM.refSaveStatisticGridControlLayout = AddressOf SaveStatisticGridControlLayout - ' rispristino layout tabella - If Not IsNothing(m_sDataGridLayoutPath) AndAlso File.Exists(m_sDataGridLayoutPath) Then - dgStatistics_GridControl.RestoreLayoutFromJson(m_sDataGridLayoutPath) - End If - ' da gestire chiamandolo quando viene aperto un progetto o aggiunto/rimosso un btl, per evitare che ci sia il GroupSummary se c'e' un solo gruppo - IsVisibleGroupSummary(False) - End Sub Private Sub PrintBtn_Click(sender As Object, e As RoutedEventArgs) Handles CopyToClipboardBtn.Click m_StatisticsVM = Me.DataContext() - 'ExportToExcelAndCsv(dgStatistics, m_StatisticsVM) - dgStatistics_GridControl.CopyToClipboard() - End Sub - - Private Sub OnShowGridMenu(sender As Object, e As DevExpress.Xpf.Grid.GridMenuEventArgs) - If e.MenuType = GridMenuType.Column Then - ' rimozione bottoni - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupBox}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupColumn}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.ColumnChooser}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFit}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFitColumns}) - e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.FilterEditor}) - - Dim info As GridColumnMenuInfo = CType(e.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - ' aggiunta separatore - Dim separator As BarItemLinkSeparator = New BarItemLinkSeparator() - e.Customizations.Add(separator) - ' aggiunta bottone AllowResize e Auto Fit - Dim AllowResize As BarCheckItem = New BarCheckItem() With {.Content = "Allow Resize", .IsChecked = (dgStatistics_TableView.AllowResizing AndAlso (item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default))} - AddHandler AllowResize.CheckedChanged, AddressOf AllowResize_CheckedChanged - e.Customizations.Add(AllowResize) - If item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default Then - Dim FixAuto As BarButtonItem = New BarCheckItem() With {.Content = "Auto Fit"} - AddHandler FixAuto.ItemClick, AddressOf FixAuto_ItemClick - e.Customizations.Add(FixAuto) - End If - End If - End Sub - - ' gestore evento Allow Resize - Private Sub AllowResize_CheckedChanged(sender As Object, e As ItemClickEventArgs) - Dim info As GridColumnMenuInfo = TryCast(dgStatistics_TableView.GridMenu.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - If item.AllowResizing = DevExpress.Utils.DefaultBoolean.False Then - item.AllowResizing = DevExpress.Utils.DefaultBoolean.True - Else - item.AllowResizing = DevExpress.Utils.DefaultBoolean.False - End If - End Sub - - ' gestore evento Auto Fit - Private Sub FixAuto_ItemClick(sender As Object, e As ItemClickEventArgs) - Dim info As GridColumnMenuInfo = TryCast(dgStatistics_TableView.GridMenu.MenuInfo, GridColumnMenuInfo) - Dim item As ColumnBase = CType(info.Column, ColumnBase) - item.Width = New GridColumnWidth(1, GridColumnUnitType.Auto) - dgStatistics_TableView.UpdateLayout() - item.Width = item.ActualWidth - item.AllowResizing = DevExpress.Utils.DefaultBoolean.False + ExportToExcelAndCsv(dgStatistics, m_StatisticsVM) End Sub End Class diff --git a/EgtBEAMWALL.Optimizer/Statistics/StatisticsVM.vb b/EgtBEAMWALL.Optimizer/Statistics/StatisticsVM.vb index 00fbd71b..464ad05b 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/StatisticsVM.vb +++ b/EgtBEAMWALL.Optimizer/Statistics/StatisticsVM.vb @@ -8,8 +8,6 @@ Public Class StatisticsVM #Region "FIELDS & PROPERTIES" - Public refSaveStatisticGridControlLayout As Action - ' Evento per chiusura finestra Public Event m_CloseWindow(bDialogResult As Boolean) @@ -397,11 +395,6 @@ Public Class StatisticsVM {S_OPTIMIZERSTATISTICS, OptimizerStatisticsColumns}, {S_RAWPARTSTATISTICS, RawPartStatisticsColumns}} EgwWPFBaseLib.EgwDataGrid.WriteColumnLayout(DataGridColumnsIniFile.m_sDataGridColumnsIniFile, DataGridColumnDictionary) - - If Not IsNothing(refSaveStatisticGridControlLayout) Then - refSaveStatisticGridControlLayout() - End If - ' Chiudo finestra senza fare niente RaiseEvent m_CloseWindow(False) End Sub diff --git a/EgtBEAMWALL.Optimizer/StatisticsWnd/StatisticWndV.xaml b/EgtBEAMWALL.Optimizer/StatisticsWnd/StatisticWndV.xaml index 0bf256e6..c055dc27 100644 --- a/EgtBEAMWALL.Optimizer/StatisticsWnd/StatisticWndV.xaml +++ b/EgtBEAMWALL.Optimizer/StatisticsWnd/StatisticWndV.xaml @@ -9,8 +9,7 @@ Title="StatisticWnd" MaxHeight="600" Width="1300" - Style="{StaticResource OptimizerWindow.Dialog}" - Closed="OptimizerWindow_Closed"> + Style="{StaticResource OptimizerWindow.Dialog}"> @@ -70,12 +65,10 @@ - - @@ -489,7 +482,7 @@ - - - - @@ -2277,10 +2254,6 @@ - - @@ -2497,13 +2470,6 @@ - - @@ -2620,7 +2586,7 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/EgtBEAMWALL.Optimizer/Utility/MapV.vb b/EgtBEAMWALL.Optimizer/Utility/MapV.vb index 40cc73ad..68db9ec6 100644 --- a/EgtBEAMWALL.Optimizer/Utility/MapV.vb +++ b/EgtBEAMWALL.Optimizer/Utility/MapV.vb @@ -1,22 +1,16 @@ Module MapV Private m_refSplashScreenV As SplashScreenV - Private m_refPDFEditorV As PDFEditorV #Region "Get" + Public ReadOnly Property refSplashScreenV As SplashScreenV Get Return m_refSplashScreenV End Get End Property - Public ReadOnly Property refPDFEditorV As PDFEditorV - Get - Return m_refPDFEditorV - End Get - End Property - #End Region ' Get #Region "Set" @@ -26,11 +20,6 @@ Return Not IsNothing(m_refSplashScreenV) End Function - Friend Function SetRefPDFEditorV(PDFEditorV As PDFEditorV) As Boolean - m_refPDFEditorV = PDFEditorV - Return Not IsNothing(m_refPDFEditorV) - End Function - #End Region ' Set End Module diff --git a/EgtBEAMWALL.Optimizer/WarehouseWnd/WarehouseWndV.xaml b/EgtBEAMWALL.Optimizer/WarehouseWnd/WarehouseWndV.xaml index 364e3274..3d9c3d33 100644 --- a/EgtBEAMWALL.Optimizer/WarehouseWnd/WarehouseWndV.xaml +++ b/EgtBEAMWALL.Optimizer/WarehouseWnd/WarehouseWndV.xaml @@ -6,16 +6,6 @@ xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer" xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core" xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib" - xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" - xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" - xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" - xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" - xmlns:dxeh="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal" - xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys" - xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" - xmlns:dxfui="http://schemas.devexpress.com/winfx/2008/xaml/core/filteringui" - xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal" - xmlns:i="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" SizeToContent="Height" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" @@ -220,70 +210,6 @@ Style="{StaticResource WAutoWnd_Button}"/> - - - + @@ -305,13 +231,13 @@ - + - + @@ -324,7 +250,7 @@ - + @@ -332,7 +258,7 @@ - + @@ -340,7 +266,7 @@ - +