20#ifndef ORES_QT_COMPUTE_TASK_VIEW_MODEL_HPP
21#define ORES_QT_COMPUTE_TASK_VIEW_MODEL_HPP
24#include <QFutureWatcher>
25#include <QAbstractTableModel>
26#include "ores.qt/AbstractClientModel.hpp"
27#include "ores.qt/ClientManager.hpp"
28#include "ores.qt/HostDisplayNameCache.hpp"
29#include "ores.logging/make_logger.hpp"
30#include "ores.compute.api/domain/batch.hpp"
31#include "ores.compute.api/domain/workunit.hpp"
32#include "ores.compute.api/domain/result.hpp"
58 inline static std::string_view logger_name =
59 "ores.qt.compute_task_view_model";
61 [[nodiscard]]
static auto& lg() {
63 static auto instance = make_logger(logger_name);
80 QObject* parent =
nullptr);
83 static QString format_state(
int server_state);
84 static QString format_outcome(
int outcome);
87 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
88 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
89 QVariant data(
const QModelIndex& index,
90 int role = Qt::DisplayRole)
const override;
91 QVariant headerData(
int section, Qt::Orientation orientation,
92 int role = Qt::DisplayRole)
const override;
110 void onTasksLoaded();
114 bool success =
false;
115 std::vector<compute_task> tasks;
116 QString error_message;
117 QString error_details;
124 std::vector<compute_task> tasks_;
125 QFutureWatcher<FetchResult>* watcher_;
126 bool is_fetching_{
false};
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
A logical grouping of workunits forming a financial computation batch.
Definition batch.hpp:35
A specific execution instance of a workunit assigned to a host.
Definition result.hpp:38
An abstract job template within a compute batch.
Definition workunit.hpp:36
Base class for all client-side entity models.
Definition AbstractClientModel.hpp:37
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:123
Shared cache mapping host UUID strings to whimsical display names.
Definition HostDisplayNameCache.hpp:42
A joined view row: one result with its workunit and batch context.
Definition ComputeTaskViewModel.hpp:39
int batch_ordinal
1-based position in the loaded batch list
Definition ComputeTaskViewModel.hpp:43
int task_ordinal
1-based position within its batch
Definition ComputeTaskViewModel.hpp:44
Read-only table model that joins results, workunits, and batches.
Definition ComputeTaskViewModel.hpp:54
void refresh()
Fetch and join all batches, workunits, and results.
Definition ComputeTaskViewModel.cpp:163
void set_host_name_cache(HostDisplayNameCache *cache)
Sets the host display-name cache (not owned).
Definition ComputeTaskViewModel.cpp:297
const compute_task * get_task(int row) const
Returns the task at the given row, or nullptr if out of range.
Definition ComputeTaskViewModel.cpp:291