diff options
Diffstat (limited to 'core/src/Model/Workflow/Evaluation.cpp')
-rw-r--r-- | core/src/Model/Workflow/Evaluation.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/core/src/Model/Workflow/Evaluation.cpp b/core/src/Model/Workflow/Evaluation.cpp index db09973..ff3edf4 100644 --- a/core/src/Model/Workflow/Evaluation.cpp +++ b/core/src/Model/Workflow/Evaluation.cpp @@ -2,6 +2,40 @@ #include <queue> +const char* WorkflowEvaluationError::FormatMessageType(enum MessageType messageType) { + switch (messageType) { + case Error: return "Error"; + case Warning: return "Warning"; + } +} + +const char* WorkflowEvaluationError::FormatPinType(enum PinType pinType) { + switch (pinType) { + case NoPin: return nullptr; + case InputPin: return "Input pin"; + case OutputPin: return "Output pin"; + } +} + +std::string WorkflowEvaluationError::Format() const { + // TODO convert to std::format + + std::string result; + result += FormatMessageType(this->Type); + result += " at "; + result += NodeId; + if (auto pinText = FormatPinType(this->PinType)) { + result += "/"; + result += pinText; + result += " "; + result += PinId; + } + result += ": "; + result += this->Message; + + return result; +} + namespace { enum class EvaluationStatus { Unevaluated, |