From 7f714ce705b9718432f3496b30d29eb476e2e6a7 Mon Sep 17 00:00:00 2001 From: Developer01 Date: Wed, 1 Jul 2026 15:26:07 +0200 Subject: [PATCH] =?UTF-8?q?Monitoring=20=C3=B6ffnen=20nach=20Klick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/TaskFlow/frmMain.vb | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/app/TaskFlow/frmMain.vb b/app/TaskFlow/frmMain.vb index 9e7d109..ea2f1bb 100644 --- a/app/TaskFlow/frmMain.vb +++ b/app/TaskFlow/frmMain.vb @@ -17,6 +17,7 @@ Imports DevExpress.XtraGrid.Views.Grid.ViewInfo Imports DevExpress.XtraNavBar Imports DevExpress.XtraPrinting Imports DevExpress.XtraSplashScreen +Imports DevExpress.XtraTreeList Imports DigitalData.GUIs.Common Imports DigitalData.Modules.Base Imports DigitalData.Modules.EDMI.API.Constants @@ -4781,7 +4782,39 @@ FROM VWPM_PROFILE_ACTIVE T WHERE T.GUID IN (SELECT PROFILE_ID FROM [dbo].[FNPM_G LOGGER.Error(ex) End Try End Sub + Private Async Sub TreeList_Cockpit_Click(sender As Object, e As EventArgs) Handles TreeList_Cockpit.Click + Try + Dim oFocusedNode As DevExpress.XtraTreeList.Nodes.TreeListNode = TreeList_Cockpit.FocusedNode + If oFocusedNode Is Nothing Then Exit Sub + Dim oTypeId As Object = oFocusedNode.GetValue("TYPE_ID") + If oTypeId Is Nothing OrElse IsDBNull(oTypeId) OrElse CInt(oTypeId) <> 2 Then + Exit Sub + End If + + ' ===== PRÜFEN OB MONITOR BEREITS GEÖFFNET IST ===== + Dim oMonitorId As Object = oFocusedNode.GetValue("FK_MONITOR_ID") + If oMonitorId Is Nothing OrElse IsDBNull(oMonitorId) Then + Exit Sub + End If + + Dim oMonitorIdInt As Integer = CInt(oMonitorId) + Dim existingMonitor = Application.OpenForms().OfType(Of frmMonitor)().FirstOrDefault(Function(f) f.MonitorID = oMonitorIdInt) + + If existingMonitor IsNot Nothing Then + ' ✅ Monitor ist offen → Nach vorne bringen + LOGGER.Debug($"TreeList_Cockpit_NodeCellClick: Monitor [{oMonitorIdInt}] already open - bringing to front") + existingMonitor.Activate() + existingMonitor.BringToFront() + Else + ' ✅ Monitor ist geschlossen → Neu öffnen via ProcessTreeListNodeAsync + LOGGER.Debug($"TreeList_Cockpit_NodeCellClick: Monitor [{oMonitorIdInt}] closed - reopening") + Await ProcessTreeListNodeAsync(oFocusedNode) + End If + Catch ex As Exception + LOGGER.Error(ex) + End Try + End Sub Private Sub BarButtonItemCock_refresh_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItemCock_refresh.ItemClick Load_Treeview() End Sub