diff --git a/include/engine/Module.hpp b/include/engine/Module.hpp index 10e83e51..91fb22c7 100644 --- a/include/engine/Module.hpp +++ b/include/engine/Module.hpp @@ -134,6 +134,12 @@ struct Module { return sq; } + template + TSwitchQuantity* configButton(int paramId, std::string name = "") { + TSwitchQuantity* sq = configParam(paramId, 0.f, 1.f, 0.f, name); + return sq; + } + /** Helper for creating a PortInfo for an input port and setting its properties. See PortInfo for documentation of arguments. */ diff --git a/src/Quantity.cpp b/src/Quantity.cpp index 6c76f303..2a87cb02 100644 --- a/src/Quantity.cpp +++ b/src/Quantity.cpp @@ -40,10 +40,11 @@ void Quantity::setDisplayValueString(std::string s) { std::string Quantity::getString() { std::string s; std::string label = getLabel(); - if (!label.empty()) - s += label + ": "; - s += getDisplayValueString(); - s += getUnit(); + std::string valueString = getDisplayValueString() + getUnit(); + s += label; + if (label != "" && valueString != "") + s += ": "; + s += valueString; return s; }