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