Starten eines einzelnen NI Profils - frmNIHauptseite

This commit is contained in:
OlgunR 2025-10-29 10:13:11 +01:00
parent c92858af08
commit d3dfabfbe2

View File

@ -44,6 +44,7 @@ Public Class frmNIHauptseite
Private licenseManager As ClassLicenseManager = Nothing
Public Shared _windream As ClassWindream_allgemein
Private Const ConstWMEntityDocument = 1 ''WINDREAMLib.WMEntity.WMEntityDocument
Private _singleProfileRun As String = ""
Public Shared Function Instance() As frmNIHauptseite
If _Instance Is Nothing OrElse _Instance.IsDisposed = True Then
_Instance = New frmNIHauptseite
@ -349,6 +350,15 @@ Public Class frmNIHauptseite
Dim _Fehler As Boolean = False
For Each profil As ClassNIProfil In ClassNIProfile.Profile
_Fehler = False
If Not String.IsNullOrWhiteSpace(_singleProfileRun) Then
If _singleProfileRun <> profil.Profilname Then
Continue For
Else
Me.aktivesProfil = profil
_Logger.Info($"Manual Run for profile [{_singleProfileRun}] will be started.")
End If
End If
' aktuelles Profil der Klasse mitteilen
Me.aktivesProfil = profil
_clsWorkfile = New clsNI_WorkFile(_MyLogger)
@ -625,6 +635,7 @@ Public Class frmNIHauptseite
' nächstes Profil an ProgressBar1
bwProfil.ReportProgress(-2)
Next
_singleProfileRun = ""
Catch ex As Exception
_Logger.Error(ex)
@ -2872,6 +2883,7 @@ Public Class frmNIHauptseite
'NI Starten aus Profilübersicht
Private Sub btnStartProfile_Click(sender As Object, e As EventArgs) Handles btnStartProfile.Click
If TimerRefresh.Enabled = False Then
TimerRefresh.Start()
Else
@ -2884,13 +2896,26 @@ Public Class frmNIHauptseite
'Abbruch_NI("Manueller Abbruch 1 durch User " & Environment.UserName, False, False)
'Me.btnStartStop.Text = "Nachindexierung starten"
Me.btnStartProfile.Enabled = True
MsgBox("Nachindexierung läuft bereits.")
MsgBox("Nachindexierung läuft bereits.", MsgBoxStyle.Information)
Else
Start_NachindexierungThreads()
My.Settings.vNIRunning = True
My.Settings.Save()
Me.btnStartStop.Text = "Nachindexierung stoppen"
Me.btnStartProfile.Enabled = False
Dim view As DevExpress.XtraGrid.Views.Grid.GridView = TryCast(gridProfileOverview.MainView, DevExpress.XtraGrid.Views.Grid.GridView)
If view Is Nothing OrElse view.FocusedRowHandle < 0 Then
MsgBox("Bitte wählen Sie ein Profil aus.", "Hinweis", MsgBoxStyle.Information)
Exit Sub
End If
Dim profilname As String = Convert.ToString(view.GetRowCellValue(view.FocusedRowHandle, "Name"))
If Not String.IsNullOrWhiteSpace(profilname) Then
_singleProfileRun = profilname
Start_NachindexierungThreads()
My.Settings.vNIRunning = True
My.Settings.Save()
btnStartStop.Text = "Nachindexierung stoppen"
btnStartProfile.Enabled = False
MsgBox($"Nachindexierung mit dem Profil: {profilname} gestartet.", MsgBoxStyle.Information)
End If
End If
manuallyRun = False
End Sub