Skip to content

Commit

Permalink
ENH: Clean manual retry infrastructure
Browse files Browse the repository at this point in the history
ENH: Add jobs status logging into the detail logging window
ENH: Generate thumbnails in workers
BUG: Fix missing update of server settings UI
BUG: Add missing Python wrapping methods for ctkJobDetail
  • Loading branch information
Punzo committed Sep 2, 2024
1 parent 6292d09 commit 909ad11
Show file tree
Hide file tree
Showing 53 changed files with 1,527 additions and 470 deletions.
13 changes: 13 additions & 0 deletions Libs/Core/ctkAbstractJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ctkAbstractJob::ctkAbstractJob()
this->MaximumConcurrentJobsPerType = 20;
this->Priority = QThread::Priority::LowPriority;
this->CreationDateTime = QDateTime::currentDateTime();
this->DestroyAfterUse = false;
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -228,6 +229,18 @@ void ctkAbstractJob::setLoggedText(QString loggedText)
this->LoggedText += loggedText;
}

//----------------------------------------------------------------------------
bool ctkAbstractJob::destroyAfterUse() const
{
return this->DestroyAfterUse;
}

//----------------------------------------------------------------------------
void ctkAbstractJob::setDestroyAfterUse(bool destroyAfterUse)
{
this->DestroyAfterUse = destroyAfterUse;
}

//----------------------------------------------------------------------------
QVariant ctkAbstractJob::toVariant()
{
Expand Down
14 changes: 13 additions & 1 deletion Libs/Core/ctkAbstractJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class CTK_CORE_EXPORT ctkAbstractJob : public QObject
Q_PROPERTY(QDateTime completionDateTime READ completionDateTime);
Q_PROPERTY(QString runningThreadID READ runningThreadID WRITE setRunningThreadID);
Q_PROPERTY(QString loggedText READ loggedText WRITE setLoggedText);
Q_PROPERTY(bool destroyAfterUse READ destroyAfterUse WRITE setDestroyAfterUse);

public:
explicit ctkAbstractJob();
Expand Down Expand Up @@ -168,7 +169,7 @@ class CTK_CORE_EXPORT ctkAbstractJob : public QObject
Q_INVOKABLE virtual ctkAbstractJob* clone() const = 0;

/// Logger report string formatting for specific job
Q_INVOKABLE virtual QString loggerReport(const QString& status) const = 0;
Q_INVOKABLE virtual QString loggerReport(const QString& status) = 0;

/// Return the QVariant value of this job.
///
Expand All @@ -177,6 +178,16 @@ class CTK_CORE_EXPORT ctkAbstractJob : public QObject
/// \sa ctkJobDetail
Q_INVOKABLE virtual QVariant toVariant();

/// Free used resources from job after worker is done
Q_INVOKABLE virtual void freeUsedResources() = 0;

///@{
/// Destroy job pointer after worker is done
/// default: false
bool destroyAfterUse() const;
void setDestroyAfterUse(bool destroyAfterUse);
///@}

Q_SIGNALS:
void started();
void userStopped();
Expand All @@ -198,6 +209,7 @@ class CTK_CORE_EXPORT ctkAbstractJob : public QObject
QDateTime CompletionDateTime;
QString RunningThreadID;
QString LoggedText;
bool DestroyAfterUse;

private:
Q_DISABLE_COPY(ctkAbstractJob)
Expand Down
45 changes: 45 additions & 0 deletions Libs/Core/ctkCorePythonQtDecorators.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,51 @@ public Q_SLOTS:
{
return td->JobUID;
}
void setCreationDateTime(ctkJobDetail* td, QString creationDateTime)
{
td->CreationDateTime = creationDateTime;
}

QString creationDateTime(ctkJobDetail* td)
{
return td->CreationDateTime;
}

void setStartDateTime(ctkJobDetail* td, QString startDateTime)
{
td->StartDateTime = startDateTime;
}
QString startDateTime(ctkJobDetail* td)
{
return td->StartDateTime;
}

void setCompletionDateTime(ctkJobDetail* td, QString completionDateTime)
{
td->CompletionDateTime = completionDateTime;
}
QString completionDateTime(ctkJobDetail* td)
{
return td->CompletionDateTime;
}

void setRunningThreadID(ctkJobDetail* td, QString runningThreadID)
{
td->RunningThreadID = runningThreadID;
}
QString runningThreadID(ctkJobDetail* td)
{
return td->RunningThreadID;
}

void setLogging(ctkJobDetail* td, QString logging)
{
td->Logging = logging;
}
QString logging(ctkJobDetail* td)
{
return td->Logging;
}
};

//-----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 909ad11

Please sign in to comment.