From db65ef9e152fab753cee4b3b452debe2c2c6b264 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Mon, 10 Jul 2023 13:24:26 +0200 Subject: [PATCH] - correzione errore di aggiornamento area di stampa su cambio tipo --- Icarus/TopPanel/TopPanelVM.vb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Icarus/TopPanel/TopPanelVM.vb b/Icarus/TopPanel/TopPanelVM.vb index 1cc2315..966a0b5 100644 --- a/Icarus/TopPanel/TopPanelVM.vb +++ b/Icarus/TopPanel/TopPanelVM.vb @@ -274,7 +274,27 @@ Public Class TopPanelVM WriteMainPrivateProfileString(S_PRINTING3D, K_CURRMACHINING, value.sGUID.ToString()) ' imposto selezionata come corrente If Not IsNothing(m_SelPart) AndAlso (IsNothing(m_SelMachining) OrElse value.sGUID <> m_SelMachining.sGUID) Then + Dim GeneralCathegory As MachiningCathegory = Map.refTopPanelVM.CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL) + Dim OldSlicingTypeValue As Machining.MPAR_SLICINGTYPE = Nothing + Dim NewSlicingTypeValue As Machining.MPAR_SLICINGTYPE = Nothing + If Not IsNothing(GeneralCathegory) Then + Dim SlicingTypeParam As ComboMachiningParam = GeneralCathegory.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.SLICINGTYPE) + If Not IsNothing(SlicingTypeParam) Then + OldSlicingTypeValue = SlicingTypeParam.SelValue.Id + End If + End If Map.refCurrMachiningPanelVM.SetCurrMachining(New CurrMachining(m_SelPart.nPartId, value.nIndex)) + GeneralCathegory = Map.refTopPanelVM.CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL) + If Not IsNothing(GeneralCathegory) Then + Dim SlicingTypeParam As ComboMachiningParam = GeneralCathegory.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.SLICINGTYPE) + If Not IsNothing(SlicingTypeParam) Then + NewSlicingTypeValue = SlicingTypeParam.SelValue.Id + End If + End If + If IsNothing(OldSlicingTypeValue) OrElse IsNothing(NewSlicingTypeValue) OrElse OldSlicingTypeValue <> NewSlicingTypeValue Then + ' aggiorno area di estrusione + CurrentMachine.UpdateExtrusionArea() + End If End If End If m_SelMachining = value