14 CONSTANT_BLOCK_HEIGHT,
15 newBlockChoiceDelegate,
16 blockLifecycleManagerDelegate,
22 logger->info(
"Double clicked at ({}, {}), opening editor", x, y);
28 const auto& newValue = maybeNewValue.value();
30 logger->info(
"Constant block {} value changed from '{}' to '{}'",
39 "The entered value is not a valid number");
Delegate that manages the lifecycles of blocks.
Delegate that is notified when a new block is chosen to be added to the canvas.
The delegate for the window.
virtual void showWarning(const std::string &title, const std::string &message)=0
Show a warning message.
virtual std::optional< FloatingPoint > promptFloatingPointInput(const std::string &title, const std::string &message, const std::optional< FloatingPoint > &defaultValue)=0
Prompt for a floating point input.
The base class for all blocks, containing common functionality and members.
std::shared_ptr< spdlog::logger > logger
business_logic::delegate::IWindowDelegate * windowDelegate
std::unordered_map< const structures::Port *, FloatingPoint > portValues
The registry of port values.
static const std::vector< business_logic::elements::structures::Port > inputPorts
ConstantBlock(int cx, int cy, business_logic::delegate::INewBlockChoiceDelegate *newBlockChoiceDelegate, business_logic::delegate::IBlockLifecycleManagerDelegate *blockLifecycleManagerDelegate, business_logic::delegate::IWindowDelegate *windowDelegate)
Constructor.
void onDoubleClick(int x, int y) override
Called when the element is double-clicked.
static const std::vector< business_logic::elements::structures::Port > outputPorts
The base classes and structs for elements.
The business logic module.
std::string stringifyAddressOf(const T *value)
Convert a pointer to a string in format "0x..." containing its hexadecimal address.