diff --git a/MachGroupPanel/MachGroupPanelVM.vb b/MachGroupPanel/MachGroupPanelVM.vb index bdcfba8..dd96343 100644 --- a/MachGroupPanel/MachGroupPanelVM.vb +++ b/MachGroupPanel/MachGroupPanelVM.vb @@ -1,6 +1,7 @@ Imports System.Collections.ObjectModel Imports System.IO Imports EgtUILib +Imports EgtWPFLib5 Public Class MachGroupPanelVM Inherits ViewModelBase @@ -74,6 +75,8 @@ Public Class MachGroupPanelVM If IniFile.m_bShowOnlyTable Then EgtShowOnlyTable(True) End If Application.Msn.NotifyColleagues(Application.MACHGROUPSRESULT, nErr) + ' Setto il Materiale in base alla Macchina associata al MachGroup selezionato + LoadMaterialType() If nErr <> 0 Then EgtDraw() End Sub @@ -319,6 +322,26 @@ Public Class MachGroupPanelVM End If End Sub + Private Sub LoadMaterialType() + Dim sMatType As String = "Wood" + ' IniFile.m_sMachineName = Map.refStatusBarVM.SelectedMachine.Name + ' IniFile.m_sCurrMachIniFilePath = Map.refStatusBarVM.SelectedMachine.MachineDirPath & "\" & Map.refStatusBarVM.SelectedMachine.Name & ".ini" + Dim sMachineIniPath = IniFile.m_sCurrMachIniFilePath + EgtUILib.GetPrivateProfileString(S_GENERAL, EgtWPFLib5.EstConstMachIni.K_MATERIAL, sMatType, sMatType, sMachineIniPath) + Select Case sMatType + Case "Stone" + EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.STONE + Case "Wood" + EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD + Case "Beam" + EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.BEAM + Case Else + ' Se il materiale spcificato nel file INI della macchina non corrisponde ai 2 sopracitati viene emesso un messaggio di errore + EgtWPFLib5.MachiningTreeViewItem.m_MatType = Nothing + MsgBox(EgtMsg(31409), MsgBoxStyle.Exclamation, EgtMsg(31551)) + End Select + End Sub + #End Region #Region "COMMANDS" @@ -345,6 +368,8 @@ Public Class MachGroupPanelVM Application.Msn.NotifyColleagues(Application.UPDATECURRENTMACHINE) Map.refSimulationExpanderVM.Estimation_IsEnabled = (EgtUILib.GetPrivateProfileInt(S_ESTIMATIONS, K_EST_ENABLE, 0, IniFile.m_sCurrMachIniFilePath) <> 0) + ' Setto il Materiale in base alla Macchina associata al MachGroup corrente + LoadMaterialType() End Sub #End Region ' SetCurrMachGroupCommand diff --git a/MachinePanel/MachinePanelVM.vb b/MachinePanel/MachinePanelVM.vb index 2ff2901..0e2092a 100644 --- a/MachinePanel/MachinePanelVM.vb +++ b/MachinePanel/MachinePanelVM.vb @@ -176,7 +176,7 @@ Public Class MachinePanelVM End If Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(IniFile.m_sCurrMachIniFilePath, IniFile.m_ProjectSceneContext, "Wood") Dim MachDbWindowV As New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM) - If MachDbWindowVM.MatType <> 0 Then + If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then MachDbWindowV.Height = 784 '674 MachDbWindowV.Width = 1024 MachDbWindowV.Owner = Application.Current.MainWindow diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index b55fcf3..3dd646a 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml index b27474c..f35c03d 100644 --- a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml @@ -76,26 +76,26 @@ - + - @@ -110,38 +110,38 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - + - @@ -110,31 +110,31 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> Public Sub UpdateMachining(ByVal param As Object) + ' Verifico la presenza di errori: se ci sono li mostro in una MessageBox ed esco da UpdateMachining + If m_CurrOperation_ErrorOnOperation Then + Dim sErrorList As String = String.Empty + For Each [property] As String In EgtWPFLib5.MachiningTreeViewItem.ValidatedProperties + If Not String.IsNullOrEmpty(m_CurrOperation.GetErrorString([property])) Then + sErrorList += Environment.NewLine + " - " + m_CurrOperation.GetErrorString([property]) + End If + Next [property] + MessageBox.Show(EgtMsg(5423) + sErrorList, EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation) + Return + End If Dim bRecalc As Boolean = ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) ' La modifica di alcuni parametri forza il ricalcolo della geometria Dim ModifiedGeometry As Boolean = m_CurrOperation.m_IsModifiedSelectedFaceUseType @@ -369,6 +393,7 @@ Public Class MachiningParameterExpanderVM m_nPtEntId = EgtPreviewMachiningTool(GDB_ID.NULL, MCH_PTM.AFTER) End If IsModified(False) ' NotifyPropertyChanged("UpdateMachiningBtn_Background") + ErrorOnOperation(False) EgtDraw() Application.Msn.NotifyColleagues(Application.EMITTITLE) End Sub @@ -383,6 +408,12 @@ Public Class MachiningParameterExpanderVM NotifyPropertyChanged("UpdateMachiningBtn_Background") End Sub + Private Sub ErrorOnOperation(ErrorOnOperation As Boolean) Handles m_CurrOperation.m_ErrorOnOperation + m_CurrOperation_ErrorOnOperation = ErrorOnOperation + ' NotifyPropertyChanged("CurrOperation_ErrorOnOperation") + NotifyPropertyChanged("UpdateMachiningBtn_Background") + End Sub + End Class ''' diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MortisingParameterExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MortisingParameterExpanderV.xaml index 24ce701..4a808f4 100644 --- a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MortisingParameterExpanderV.xaml +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MortisingParameterExpanderV.xaml @@ -76,26 +76,26 @@ - + - @@ -110,32 +110,32 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - + - @@ -103,44 +103,44 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - + - @@ -97,37 +97,37 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - + - @@ -110,27 +110,27 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - + - @@ -133,7 +133,7 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - + - @@ -107,7 +107,7 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - + - @@ -104,41 +104,41 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - @@ -110,7 +110,7 @@ - + - @@ -103,37 +103,37 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - + - @@ -110,38 +110,38 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1"> - @@ -328,7 +334,7 @@ - + - @@ -117,38 +117,38 @@ Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1">