diff --git a/Base/TreeView/TreeViewItemBase.vb b/Base/TreeView/TreeViewItemBase.vb
index 934ae42..fd3b4fa 100644
--- a/Base/TreeView/TreeViewItemBase.vb
+++ b/Base/TreeView/TreeViewItemBase.vb
@@ -41,20 +41,6 @@ Public Class TreeViewItemBase
Set(value As Boolean)
If (value <> m_isExpanded) Then
m_isExpanded = value
- If Not Map.refProjectVM.bSelObjOnScene Then
- Dim m_onldObjTreeOldId As Integer = Map.refManageLayerExpanderVM.m_nObjTreeOldId
- If m_isExpanded Then
- For Each Item As LayerTreeViewItem In Map.refManageLayerExpanderVM.LayerList
- For Each LayerItem As LayerTreeViewItem In Item.Items
- If m_isExpanded = LayerItem.m_isExpanded Then
- If m_onldObjTreeOldId <> LayerItem.Id Then
- Map.refManageLayerExpanderVM.SelectIdInObjTree(LayerItem.Id)
- End If
- End If
- Next
- Next
- End If
- End If
NotifyPropertyChanged("IsExpanded")
End If
End Set
diff --git a/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderV.xaml b/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderV.xaml
index 21cf0c4..29e5dce 100644
--- a/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderV.xaml
+++ b/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderV.xaml
@@ -21,7 +21,7 @@
-
diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/MachiningOpListBoxItem.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/MachiningOpListBoxItem.vb
index b31e65e..468b9f4 100644
--- a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/MachiningOpListBoxItem.vb
+++ b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/MachiningOpListBoxItem.vb
@@ -154,7 +154,7 @@ Public Class MachiningOpListBoxItem
Private m_cmdModifyNameEnter As ICommand
Private m_cmdModifyNameEsc As ICommand
- Sub New(nId As Integer, bStatus As Boolean, sName As String, nType As Integer, sTool As String, sMach As String, bOnOff As Boolean)
+ Sub New(nId As Integer, bStatus As Boolean, sName As String, nType As Integer, sTool As String, sMach As String)
m_Id = nId
Me.Status = bStatus
Me.Name = sName
@@ -170,7 +170,6 @@ Public Class MachiningOpListBoxItem
Me.Tool = If(Not String.IsNullOrEmpty(sTool), "(" & sTool & ")", String.Empty)
Me.m_LibMach = sMach
End If
- m_bOnOff = bOnOff
End Sub
Private Function ConvertTypeToImage(Type As Integer) As String
diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/OperationListBoxItem.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/OperationListBoxItem.vb
index cc82334..197bf27 100644
--- a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/OperationListBoxItem.vb
+++ b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/OperationListBoxItem.vb
@@ -74,7 +74,7 @@ Public Class OperationListBoxItem
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveDown_IsEnabled")
NotifyPropertyChanged("IsSelected")
' Aggiorno visualizzazione
- EgtDraw()
+ If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
Return
End If
' Imposto la fase di lavorazione corrente
@@ -124,7 +124,7 @@ Public Class OperationListBoxItem
Map.refMachiningTreeExpanderVM.nSelectedOperationId = Me.Id
End If
' Aggiorno visualizzazione
- EgtDraw()
+ If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
End If
' Resetto valori slider
If Not IsNothing(Map.refMachiningParameterExpanderVM) Then
diff --git a/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb b/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb
index 9982d79..2570e82 100644
--- a/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb
+++ b/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb
@@ -122,6 +122,27 @@ Public Class OperationsListExpanderVM
End Set
End Property
+ Private m_StatusLampList As New ObservableCollection(Of StatusLamp)
+ Public Property StatusLampList As ObservableCollection(Of StatusLamp)
+ Get
+ Return m_StatusLampList
+ End Get
+ Set(value As ObservableCollection(Of StatusLamp))
+ m_StatusLampList = value
+ End Set
+ End Property
+
+ ' Forza il disegno quando seleziono la lampadina
+ Private m_ForceDrawInIsSelected As Boolean = True
+ Public Property ForceDrawInIsSelected As Boolean
+ Get
+ Return m_ForceDrawInIsSelected
+ End Get
+ Set(value As Boolean)
+ m_ForceDrawInIsSelected = value
+ End Set
+ End Property
+
Public ReadOnly Property DuplicateCmd_IsEnabled As Boolean
Get
Dim SelType As Integer = MCH_OY.NONE
@@ -619,6 +640,8 @@ Public Class OperationsListExpanderVM
''' Execute the Point. This method is invoked by the PointCommand.
'''
Public Sub Update()
+ Dim tmpStatusLamp As New StatusLamp()
+ Map.refOperationsListExpanderVM.StatusLampList = tmpStatusLamp.LoadStatusLamp()
' Cursore di attesa
Application.Current.MainWindow.ForceCursor = True
Application.Current.MainWindow.Cursor = Cursors.Wait
@@ -628,6 +651,7 @@ Public Class OperationsListExpanderVM
Dim bOk As Boolean = EgtApplyAllMachinings(bRecalc, False, sErr)
EgtSetModified()
' Deseleziono l'Operazione selezionata e la de-evidenzio nel Disegno
+ m_ForceDrawInIsSelected = False
For Each Operation In OperationList
If Operation.IsSelected Then
Operation.IsSelected = False
@@ -635,6 +659,9 @@ Public Class OperationsListExpanderVM
Next
' Ricarico la lista delle Operazioni
LoadOperationList(GDB_ID.NULL)
+ ' Rimetto le lampadine in modo corretto
+ tmpStatusLamp.UpdateStatusLamp()
+ m_ForceDrawInIsSelected = True
' Aggiorno visualizzazione e ritorno a cursore standard
EgtDraw()
Application.Current.MainWindow.ForceCursor = False
@@ -1018,7 +1045,6 @@ Public Class OperationsListExpanderVM
Dim OpType As Integer = 0
Dim OpTool As String = String.Empty
Dim OpMach As String = String.Empty
- Dim bTemp As Boolean = False
Id = EgtGetFirstOperation()
While Id <> GDB_ID.NULL
EgtGetOperationName(Id, OpName)
@@ -1030,7 +1056,7 @@ Public Class OperationsListExpanderVM
EgtGetMachiningParam(MCH_MP.TOOL, OpTool)
EgtGetMachiningParam(MCH_MP.NAME, OpMach)
' Dichiarato per far si che le due liste operino in contemporaneo
- Dim local_MachiningOpListBoxItem As New MachiningOpListBoxItem(Id, OpStatus, OpName, OpType, OpTool, OpMach, True)
+ Dim local_MachiningOpListBoxItem As New MachiningOpListBoxItem(Id, OpStatus, OpName, OpType, OpTool, OpMach)
OperationList.Add(local_MachiningOpListBoxItem)
' Lista creata per lavorare solo su le operazioni di macchina, utilizzata per la gestione dello spegnimento e accensione delle lamp
tmpOperationList.Add(local_MachiningOpListBoxItem)
@@ -1298,4 +1324,70 @@ Public Class OperationsListExpanderVM
#End Region ' Methods
+End Class
+
+Public Class StatusLamp
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_nId As Integer
+ Public Property nId As Integer
+ Get
+ Return m_nId
+ End Get
+ Set(value As Integer)
+ m_nId = value
+ End Set
+ End Property
+
+ Private m_bStatusLamp As Boolean
+ Public Property bStatusLamp As Boolean
+ Get
+ Return m_bStatusLamp
+ End Get
+ Set(value As Boolean)
+ m_bStatusLamp = value
+ End Set
+ End Property
+
+#End Region ' Fields & Properties
+
+#Region "CONSTRUCTOR"
+
+ Sub New(nId As Integer, bStatusLamp As Boolean)
+ m_nId = nId
+ m_bStatusLamp = bStatusLamp
+ End Sub
+
+ Sub New()
+
+ End Sub
+
+#End Region ' Constructor
+
+#Region "METHODS"
+
+ Public Function LoadStatusLamp() As ObservableCollection(Of StatusLamp)
+ Dim tmpStatusLampList As New ObservableCollection(Of StatusLamp)
+ For Each ItemOp As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
+ tmpStatusLampList.Add(New StatusLamp(ItemOp.Id, ItemOp.OnOff))
+ Next
+ Return tmpStatusLampList
+ End Function
+
+ Public Sub UpdateStatusLamp()
+ Dim tmpStatusLamp As StatusLamp
+ If Not IsNothing(Map.refOperationsListExpanderVM.tmpOperationList) Then
+ For Each ItemOp As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
+ tmpStatusLamp = Map.refOperationsListExpanderVM.StatusLampList.FirstOrDefault(Function(x) x.nId = ItemOp.Id)
+ If Not tmpStatusLamp.bStatusLamp Then
+ EgtSetStatus(ItemOp.Id, GDB_ST.OFF)
+ ItemOp.OnOff = False
+ End If
+ Next
+ End If
+ End Sub
+
+#End Region ' Methods
+
End Class
\ No newline at end of file
diff --git a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb
index ae73c02..e6ac790 100644
--- a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb
+++ b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb
@@ -17,6 +17,9 @@ Public Class SimulationExpanderVM
Set(value As Boolean)
If value <> m_Simulation_IsExpanded Then
Map.refMachiningOptionPanelVM.Set_IsExpanded(MachiningOptionPanelVM.MachiningOptionPanelExpander.SIMULATION, value)
+ Map.refOperationsListExpanderVM.StatusLampList.Clear()
+ Dim tmpStatusLamp As New StatusLamp()
+ Map.refOperationsListExpanderVM.StatusLampList = tmpStatusLamp.LoadStatusLamp()
End If
End Set
End Property
diff --git a/Project/ProjectVM.vb b/Project/ProjectVM.vb
index cf855ff..981691c 100644
--- a/Project/ProjectVM.vb
+++ b/Project/ProjectVM.vb
@@ -66,7 +66,6 @@ Public Class ProjectVM
' Variabile per implementazione eventi
Private m_InputText As String
- Friend bSelObjOnScene As Boolean = False
#End Region
@@ -1327,17 +1326,17 @@ Public Class ProjectVM
ElseIf IniFile.m_ProjectMode = ProjectModeOpt.MACHINING And m_SceneSelType = SceneSelTypeOpt.MACHINING And
(EgtGetType(nId) = GDB_TY.SRF_MESH Or EgtGetType(nId) = GDB_TY.SRF_FRGN) Then
If Not EgtIsSelectedObj(nId) Then m_Controller.MouseSelectedObj(nId, bLast)
- Else
- m_Controller.MouseSelectedObj(nId, false)
- If EgtIsSelectedObj( nId) then
+ ElseIf Not Keyboard.IsKeyDown(Key.LeftShift) Then
+ m_Controller.MouseSelectedObj(nId, False)
+ If EgtIsSelectedObj(nId) Then
' Selezione layer in albero
- bSelObjOnScene = True
Map.refManageLayerExpanderVM.UpdateObjInObjTreeNoMark(nId)
Map.refManageLayerExpanderVM.SelectIdInObjTreeNoMark(nId)
Map.refManageLayerExpanderVM.UpdateObjTree()
- bSelObjOnScene = False
End If
EgtDraw()
+ Else
+ m_Controller.MouseSelectedObj(nId, bLast)
End If
End Sub