From 467e9992d431ef8088ab7beeb17717990d2cd389 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 13 Oct 2016 15:20:04 +0000 Subject: [PATCH] =?UTF-8?q?EgtCAM5=201.6v7=20:=20-=20aggiornamento=20lista?= =?UTF-8?q?=20lavorazioni=20alla=20chiusura=20finestra=20DB=20lavorazioni?= =?UTF-8?q?=20-=20corretta=20visualizzazione=20utensile=20di=20lavorazione?= =?UTF-8?q?=20in=20finestra=20DB=20lavorazioni=20-=20aggiunta=20icona=20pe?= =?UTF-8?q?r=20Region=20-=20disabilitato=20doppio=20click=20su=20barra=20d?= =?UTF-8?q?i=20scorrimento=20verticale=20di=20lista=20lavorazioni=20-=20ge?= =?UTF-8?q?stione=20visualizzazione=20pi=C3=B9=20fasi=20di=20lavorazione?= =?UTF-8?q?=20-=20corretta=20gestione=20geometria=20modificata=20per=20lav?= =?UTF-8?q?orazione=20-=20corretta=20gestione=20overlap=20in=20operazione?= =?UTF-8?q?=20fresatura.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application.xaml.vb | 1 + EgtCAM5.vbproj | 6 +++ MachiningsDbWindow/MachiningTreeView.vb | 2 +- MachiningsDbWindow/MachiningsDbViewModel.vb | 1 + My Project/AssemblyInfo.vb | 4 +- .../ManageLayerExpanderViewModel.vb | 2 +- .../MachiningTreeExpanderView.xaml.vb | 13 ++++++ .../MachiningTreeExpanderViewModel.vb | 2 +- .../OperationExpanderViewModel.vb | 39 ++++++++++-------- .../OperationExpander/OperationListBox.vb | 4 +- .../OptionPanel/OptionPanelViewModel.vb | 1 + Resources/TreeView/SFlatRegion.ico | Bin 0 -> 318 bytes StatusBar/StatusBarViewModel.vb | 2 +- TopCommandBar/TopCommandBarViewModel.vb | 3 +- 14 files changed, 54 insertions(+), 26 deletions(-) create mode 100644 ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb create mode 100644 Resources/TreeView/SFlatRegion.ico diff --git a/Application.xaml.vb b/Application.xaml.vb index 86b98a4..6b49f76 100644 --- a/Application.xaml.vb +++ b/Application.xaml.vb @@ -175,6 +175,7 @@ Class Application Friend Const SIMULATIONEXPANDER_GET_ISEXPANDED As String = "Get_SimulationExpander_IsExpanded" Friend Const SIMULATIONEXPANDER_SET_ISEXPANDED As String = "Set_SimulationExpander_IsExpanded" Friend Const CANCELOPERATIONCOMMAND As String = "CancelOperationCommand" + Friend Const UPDATEOPERATIONMACHININGLIST As String = "UpdateOperationMachiningList" ' StatusBar messages Friend Const STATUSGRIDCOMMAND As String = "StatusGridCommand" diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj index a5dddc1..e15ec6c 100644 --- a/EgtCAM5.vbproj +++ b/EgtCAM5.vbproj @@ -176,6 +176,9 @@ MachGroupPanelView.xaml + + MachiningTreeExpanderView.xaml + PopUpGridPanelView.xaml @@ -552,6 +555,9 @@ + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtCAM5\EgtCAM5R32.exe diff --git a/MachiningsDbWindow/MachiningTreeView.vb b/MachiningsDbWindow/MachiningTreeView.vb index 3ab15fe..d5c423f 100644 --- a/MachiningsDbWindow/MachiningTreeView.vb +++ b/MachiningsDbWindow/MachiningTreeView.vb @@ -1367,8 +1367,8 @@ Public Class MachiningTreeViewItem EgtTdbGetCurrToolParam(MCH_TP.RADOFFSET, dVal) OffSl = LenToString(dVal, 4) End If - NotifyPropertyChanged("SelectedTool") End If + NotifyPropertyChanged("SelectedTool") End If End Set End Property diff --git a/MachiningsDbWindow/MachiningsDbViewModel.vb b/MachiningsDbWindow/MachiningsDbViewModel.vb index afa6978..2c61c19 100644 --- a/MachiningsDbWindow/MachiningsDbViewModel.vb +++ b/MachiningsDbWindow/MachiningsDbViewModel.vb @@ -666,6 +666,7 @@ Namespace EgtCAM5 End If ' Salvataggio DB lavorazioni EgtMdbSave() + Application.Msn.NotifyColleagues(Application.UPDATEOPERATIONMACHININGLIST) ' Chiusura finestra For Each Window In Application.Current.Windows If TypeOf Window Is MachiningsDbView Then diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 0aa5b5b..adb9bf3 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/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb index 887b53d..531c39a 100644 --- a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb +++ b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb @@ -743,7 +743,7 @@ Namespace EgtCAM5 Case GDB_TY.SRF_MESH Return "/Resources/TreeView/STriMesh.ico" Case GDB_TY.SRF_FRGN - Return "/Resources/TreeView/Folder.png" + Return "/Resources/TreeView/SFlatRegion.ico" Case GDB_TY.EXT_TEXT Return "/Resources/TreeView/Text.ico" End Select diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb new file mode 100644 index 0000000..a52cae9 --- /dev/null +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb @@ -0,0 +1,13 @@ +Public Class MachiningTreeExpanderView + + ' Evento necessario per impedire che venga creata la lavorazione quando si fa doppio click sulla ScrollBar + Private Sub MachiningsTreeView_MouseDoubleClick(sender As Object, e As System.Windows.Input.MouseButtonEventArgs) Handles MachiningsTreeView.MouseDoubleClick + Dim src As DependencyObject = VisualTreeHelper.GetParent(DirectCast(e.OriginalSource, DependencyObject)) + + ' Your logic here + If TypeOf src Is Control AndAlso src.[GetType]() <> GetType(Grid) Then + e.Handled = True + End If + End Sub + +End Class diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb index f80fc2b..47386d2 100644 --- a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb @@ -49,7 +49,7 @@ Namespace EgtCAM5 ' Per caricare l'albero la prima volta che viene aperto IsEnabled = False LoadSelectedMachineMachinings() - Application.Msn.Register(Application.MACHININGMODE_ISCHECKED, Sub() + Application.Msn.Register(Application.UPDATEOPERATIONMACHININGLIST, Sub() m_MachiningsList.Clear() LoadSelectedMachineMachinings() End Sub) diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb index 7695dbb..c7756a5 100644 --- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb @@ -198,12 +198,15 @@ Namespace EgtCAM5 EgtResetMark(m_LastMarkedOperationId) ' Ne deseleziono la geometria EgtDeselectAll() - EgtDraw() + End If + ' Imposto la fase di lavorazione corrente + Dim nPhase As Integer = EgtGetOperationPhase(value.Id) + If nPhase <> 0 Then + EgtSetCurrPhase(nPhase) End If ' Verifico se l'operazione è una disposizione If EgtGetOperationType(value.Id) = MCH_OY.DISP Then - - ' L'operazione è una lavorazione + ' L'operazione è una lavorazione Else ' Imposto come corrente la lavorazione(operazione) selezionata EgtSetCurrMachining(value.Id) @@ -219,12 +222,13 @@ Namespace EgtCAM5 End If CountIndex += 1 End While - EgtDraw() ' La salvo come ultima operazione selezionata m_LastMarkedOperationId = value.Id ' Notifico l'operazione selezionata all'expander dei parametri operazione Application.Msn.NotifyColleagues(Application.SELECTEDOPERATION, value) End If + ' Aggiorno visualizzazione + EgtDraw() End If m_SelectedOperation = value End If @@ -691,6 +695,8 @@ Namespace EgtCAM5 ListIsExpanded = True Else If Not IsNothing(SelectedOperation) Then + ' Salvo indice operazione selezionata + Dim nPrevOperId As Integer = EgtGetPrevOperation(SelectedOperation.Id) ' Smarco e deseleziono la geometria selezionata EgtResetMark(m_LastMarkedOperationId) EgtDeselectAll() @@ -698,7 +704,7 @@ Namespace EgtCAM5 ' Rimuovo l'operazione selezionata EgtRemoveOperation(SelectedOperation.Id) ' Ricarico la lista delle operazioni - Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST, -1) + Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST, nPrevOperId) End If End If End Sub @@ -871,7 +877,7 @@ Namespace EgtCAM5 #Region "ReloadMachiningCommand" ''' - ''' Returns a command that do Point. + ''' Restituisce funzione per ricalcolo lavorazione. ''' Public ReadOnly Property ReloadMachiningCommand As ICommand Get @@ -883,14 +889,11 @@ Namespace EgtCAM5 End Property ''' - ''' Execute the Point. This method is invoked by the PointCommand. + ''' Ricalcola una lavorazione. ''' Public Sub ReloadMachining(ByVal param As Object) ' Aggiorno valore depth SelectedOperation.NotifyPropertyChanged("Depth") - ' Verifico se la geometria è cambiata - ' Parametro che indica se ci sono state modifiche - Dim ModifiedGeometry As Boolean = False ' Carico tutta la geometria selezionata in una lista Dim SelectedGeometry As New List(Of Integer) Dim EntityIndex As Integer = EgtGetFirstSelectedObj() @@ -898,16 +901,20 @@ Namespace EgtCAM5 SelectedGeometry.Add(EntityIndex) EntityIndex = EgtGetNextSelectedObj() End While - ' Carico un elemento della geometria di lavorazione - Dim CountIndex = 0 + ' Verifico se la geometria è cambiata, confrontando selezione attuale con geometria di lavorazione + Dim ModifiedGeometry As Boolean = False + Dim CountIndex As Integer = 0 EntityIndex = 0 - Dim SubEntityIndex As Integer = 0 ' Nell'interfaccia non si usa ma devo comunque definirla perchè la funzione la restituisce obbligatoriamente + Dim SubEntityIndex As Integer = 0 ' Sottocomponente, per ora non usato ma necessario While EgtGetMachiningGeometry(CountIndex, EntityIndex, SubEntityIndex) - If SubEntityIndex = GDB_ID.NULL Then - If SelectedGeometry.IndexOf(EntityIndex) < 0 Then + If SubEntityIndex = GDB_ID.NULL And CountIndex < SelectedGeometry.Count() Then + If SelectedGeometry(CountIndex) <> EntityIndex Then ModifiedGeometry = True Exit While End If + Else + ModifiedGeometry = True + Exit While End If CountIndex += 1 End While @@ -916,8 +923,6 @@ Namespace EgtCAM5 End If ' Imposto geometria selezionata come geometria di lavorazione If ModifiedGeometry Then EgtSetMachiningGeometry(SelectedGeometry.ToArray) - ' Verifico se i parametri sono cambiati - ' Se necessario ricalcolo la lavorazione EgtApplyMachining(ModifiedGeometry) EgtDraw() diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBox.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBox.vb index 0dd5e29..b95e891 100644 --- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBox.vb +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBox.vb @@ -162,13 +162,13 @@ Public Class OperationListBoxItem Public Property OverLap As String Get Dim dOverLap As Double = 0 - EgtGetMachiningParam(MCH_MP.OVERLAP, dOverLap) + EgtGetMachiningParam(MCH_MP.OVERL, dOverLap) Return LenToString(dOverLap, 4) End Get Set(value As String) Dim dOverLap As Double = 0 StringToLen(value, dOverLap) - EgtSetMachiningParam(MCH_MP.OVERLAP, dOverLap) + EgtSetMachiningParam(MCH_MP.OVERL, dOverLap) End Set End Property diff --git a/ProjectPage/OptionPanel/OptionPanelViewModel.vb b/ProjectPage/OptionPanel/OptionPanelViewModel.vb index 267db17..6d2923f 100644 --- a/ProjectPage/OptionPanel/OptionPanelViewModel.vb +++ b/ProjectPage/OptionPanel/OptionPanelViewModel.vb @@ -75,6 +75,7 @@ Namespace EgtCAM5 Application.Msn.Register(Application.MACHININGMODE_ISCHECKED, Sub() m_DrawIsChecked = False m_MachiningIsChecked = True + EgtZoom(ZM.ALL, False) OnPropertyChanged("ManageLayerExpander") OnPropertyChanged("InfoExpander") OnPropertyChanged("InputExpander") diff --git a/Resources/TreeView/SFlatRegion.ico b/Resources/TreeView/SFlatRegion.ico new file mode 100644 index 0000000000000000000000000000000000000000..70b78d5ea652ee3c159d0f94d6dc86b69a2c505e GIT binary patch literal 318 zcmYL@F%H8Z3`IX`rL0VyJLVR>nxzi876(Ad6?y=axdW2>KTaCM^Ecl{03@!QGk`nh z1Uy*HM9z~W`U)F4l6oS-qG>i}lvxr(DTO0GHr!PaE?GLCQ5Bo}x-&NKlA*MR%DY%c w-MsGVw`0B?_o;p5eX5FD^-ARPy}trw3XCe2C79m)?2R5N diff --git a/TopCommandBar/TopCommandBarViewModel.vb b/TopCommandBar/TopCommandBarViewModel.vb index 42afb0a..ba69b79 100644 --- a/TopCommandBar/TopCommandBarViewModel.vb +++ b/TopCommandBar/TopCommandBarViewModel.vb @@ -123,9 +123,10 @@ Namespace EgtCAM5 End Sub) Application.Msn.Register(Application.MACHGROUPSRESULT, Sub(bOk As Boolean) If bOk Then + 'EgtZoom(ZM.ALL) Application.Msn.NotifyColleagues(Application.UPDATECURRENTMACHINE) Application.Msn.NotifyColleagues(Application.MACHININGMODE_ISCHECKED) - EgtZoom(ZM.ALL) + Application.Msn.NotifyColleagues(Application.UPDATEOPERATIONMACHININGLIST) IniFile.m_ProjectMode = ProjectModeOpt.MACHINING Else m_MachiningIsChecked = False