Commit 55ad2798 authored by Nick Draper's avatar Nick Draper
Browse files

Reslove MonitorData not showing in the workbench algorithm details box

This was due to:
1. Too long a default UpdateEvery default
2. Too infrequest progress updates from MonitorLiveData
3. The Algorithm Details box not adding an algorithm until it sends a progress update
4. The StartLiveData custom Dialog not showing the default for UpdateEvery

1. Decreased the default UpdateEvery from 60 to 30 seconds
2. Change the default timeout for FakeISISHistongramDAE from 30 to 60s
3. improved the progress logging for MonitorLivedata to update more frequently with an idle counter as well.
4. Changed the tie function used in custom algorithm dialogs to set the placeholder text for line edits
5. Changed the log level for user cancelling of algorithms from Error to warning so it does not trigger the notification service
6. Changed the log message for user cancellation from Terminated to cancelled to reduce confusion

re #27077
parent 2e9a3d52
......@@ -686,7 +686,7 @@ bool Algorithm::executeInternal() {
} catch (CancelException &ex) {
m_runningAsync = false;
m_running = false;
getLogger().error() << this->name() << ": Execution terminated by user.\n";
getLogger().warning() << this->name() << ": Execution cancelled by user.\n";
new ErrorNotification(this, ex.what()));
......@@ -20,7 +20,7 @@ DECLARE_ALGORITHM(FakeISISHistoDAE)
namespace {
// Time we'll wait on a receive call (in seconds)
const long RECV_TIMEOUT = 30;
const long RECV_TIMEOUT = 60;
typedef enum {
ISISDSUnknown = 0,
......@@ -151,15 +151,21 @@ void MonitorLiveData::exec() {
// Exit if the user presses cancel
DateAndTime now = DateAndTime::getCurrentTime();
double seconds = DateAndTime::secondsFromDuration(now - lastTime);
// Report progress and exit if the user presses cancel
progress(0.0, "Live Waiting " + Strings::toString((int)seconds) +
" of " + Strings::toString((int)UpdateEvery) + "s");
// Sleep for 50 msec
DateAndTime now = DateAndTime::getCurrentTime();
double seconds = DateAndTime::secondsFromDuration(now - lastTime);
if (seconds > UpdateEvery) {
lastTime = now;
g_log.notice() << "Loading live data chunk " << m_chunkNumber << " at "
<< now.toFormattedString("%H:%M:%S") << '\n';
progress(0.0, "Live Data " + Strings::toString(m_chunkNumber));
// Time to run LoadLiveData again
Algorithm_sptr alg = createChildAlgorithm("LoadLiveData");
......@@ -62,9 +62,9 @@ void StartLiveData::init() {
"You must specify the StartTime property if this is checked.");
std::make_unique<PropertyWithValue<double>>("UpdateEvery", 60.0,
std::make_unique<PropertyWithValue<double>>("UpdateEvery", 30.0,
"Frequency of updates, in seconds. Default 60.\n"
"Frequency of updates, in seconds. Default 30.\n"
"If you specify 0, MonitorLiveData will not launch and you will get only "
"one chunk.");
......@@ -29,6 +29,7 @@ Improvements
- An exclude property has been added to the fit property browser
- The images tab in figure options no longer forces the max value to be greater than the min value.
- Double clicking on a workspace that only has a single bin of data (for example from a constant wavelength source) will now plot that bin, also for single bin workspaces a plot bin option has been added to the right click plot menu of the workspace.
- Default values for algorithm properties now appear as placeholder (greyed-out) text on custm algorithm dialogs.
......@@ -39,5 +40,6 @@ Bugfixes
- Running an algorithm that reduces the number of spectra on an active plot (eg SumSpectra) no longer causes an error
- Fix crash when loading a script with syntax errors
- The Show Instruments right click menu option is now disabled for workspaces that have had their spectrum axis converted to another axis using :ref:`ConvertSpectrumAxis <algm-ConvertSpectrumAxis>`. Once this axis has been converetd the workspace loses it's link between the data values and the detectors they were recorded on so we cannot display it in the instrument view.
- MonitorLiveData now appears promptly in the algorithm details window, allowing live data sessions to be cancelled.
:ref:`Release 4.3.0 <v4.3.0>`
......@@ -896,7 +896,7 @@ void EnggDiffractionPresenter::doNewCalibration(const std::string &outFilename,
} catch (Mantid::API::Algorithm::CancelException &) {
m_calibFinishedOK = false;
m_cancelled = true;
g_log.error() << "Execution terminated by user. \n";
g_log.warning() << "Execution cancelled by user. \n";
// restore normal data search paths
......@@ -54,6 +54,11 @@ class EXPORT_OPT_MANTIDQT_COMMON PropertyWidget : public QWidget {
/// Set the placeholder text of the given field based on the default value of
/// the given property.
static void setFieldPlaceholderText(Mantid::Kernel::Property *prop,
QLineEdit *field);
PropertyWidget(Mantid::Kernel::Property *prop, QWidget *parent = nullptr,
......@@ -123,11 +128,6 @@ protected:
/// the given property.
static void setLabelFont(Mantid::Kernel::Property *prop, QWidget *label);
/// Set the placeholder text of the given field based on the default value of
/// the given property.
static void setFieldPlaceholderText(Mantid::Kernel::Property *prop,
QLineEdit *field);
/// Property being looked at. This is NOT owned by the widget
Mantid::Kernel::Property *m_prop;
......@@ -15,6 +15,7 @@
#include "MantidQtWidgets/Common/FilePropertyWidget.h"
#include "MantidQtWidgets/Common/HelpWindow.h"
#include "MantidQtWidgets/Common/MantidWidget.h"
#include "MantidQtWidgets/Common/PropertyWidget.h"
#include <QCheckBox>
#include <QCloseEvent>
......@@ -566,6 +567,15 @@ QWidget *AlgorithmDialog::tie(QWidget *widget, const QString &property,
setPreviousValue(widget, property);
// If the widget is a line edit and has no value then set the placeholder text
// to the default value.
QLineEdit *textfield = qobject_cast<QLineEdit *>(widget);
if ((textfield) && (textfield->text() == "")) {
if (prop) {
PropertyWidget::setFieldPlaceholderText(prop, textfield);
return validlbl;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment