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
  • Loading branch information
Punzo committed Sep 2, 2024
1 parent 6292d09 commit 7d269d3
Show file tree
Hide file tree
Showing 45 changed files with 1,284 additions and 417 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
Loading

0 comments on commit 7d269d3

Please sign in to comment.