Class Avogadro::MoleQueue::MoleQueueWidget#

class MoleQueueWidget : public QWidget#

The MoleQueueWidget class provides a widget for configuring and submitting a MoleQueue::JobObject.

<avogadro/molequeue/molequeuewidget.h>

Unnamed Group

JobObject &jobTemplate()#

A “template” MoleQueue::JobObject that is used to initialize the GUI. Should be fully configured to submit, as this is used to initialize job that will be submitted by submitJobRequest.

const JobObject &jobTemplate() const#

A “template” MoleQueue::JobObject that is used to initialize the GUI. Should be fully configured to submit, as this is used to initialize job that will be submitted by submitJobRequest.

void setJobTemplate(const JobObject &job)#

A “template” MoleQueue::JobObject that is used to initialize the GUI. Should be fully configured to submit, as this is used to initialize job that will be submitted by submitJobRequest.

Public Functions

explicit MoleQueueWidget(QWidget *parent_ = nullptr)#
~MoleQueueWidget() override#
void showAndSelectProgram(const QString &programName)#

Expand all queue nodes that contain a program that matches programName and select the first matching program node. Matches are case insensitive.

inline bool submissionSuccess() const#
Returns:

True if the last submission was successful. Only valid after jobSubmitted has been emitted.

inline QString jobState() const#
Returns:

True if the last submission was successful. Only valid after jobSubmitted has been emitted.

inline bool jobCompleted() const#
Returns:

True if the job has finished running.

inline bool jobSuccess() const#
Returns:

true if the job completed without error.

inline int requestId() const#
Returns:

The request id associated with the last call to submitJobRequest. -1 if there was a submission error.

inline unsigned int moleQueueId() const#

Note

If an error occurs, InvalidMoleQueueId will be returned.

Returns:

The MoleQueue ID associated with the last submitJobRequest() call. Only valid after jobSubmitted has been emitted.

inline QString submissionError() const#
Returns:

A string describing the submission error when submissionSuccess() return false.

bool openOutput() const#
Returns:

True if the user has requested that the output file be opened when the calculation completes.

bool requestJobLookup()#

Request the current state of the job identified by moleQueueId() from the server. The result will be emitted in the jobUpdated() signal.

Returns:

True if moleQueueId() is valid and the server is connected, false if the request cannot be sent.

void setBatchMode(bool batch)#

If the widget is in ‘batch mode’, options that don’t make sense are hidden (such as ‘open output when finished’).

bool batchMode() const#
bool programSelected()#
Returns:

True if the user has selected a program, false otherwise.

JobObject configuredJob() const#
Returns:

A JobObject with the GUI options. Any settings in jobTemplate that are not handled by the GUI are passed through untouched to the new object.

Public Slots

void refreshPrograms()#

Query the MoleQueue server (if available) for the list of available queues and programs.

int submitJobRequest()#

Submit the job returned by configuredJob() to MoleQueue.

Note

The result of the submission request can be checked by monitoring jobSubmitted, which will always be emitted after this slot is called.

Returns:

The request id associated with the submission, or -1 on error.

Signals

void jobSubmitted(bool success)#

Emitted after a call to submitJobRequest

Parameters:

success – True if the job has been accepted by MoleQueue.

void jobFinished(bool success)#

Emitted after jobSubmitted is emitted and the job completes.

Parameters:

success – True if the job enters the “Finished” state. False if the job enters the “Canceled” or “Error” states.

void jobUpdated(const JobObject &job)#

Emitted after a successful call to requestJobLookup().

Parameters:

job – The result of the lookupJob() RPC query.

Public Static Attributes

static const unsigned int InvalidMoleQueueId#

Indicates an invalid MoleQueue ID in the moleQueueId() result.