123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #include "Parameter.h"
- namespace mdd {
- Parameter::Parameter()
- : ModuleBase(R"JSON(
- [{
- "name":"appendix",
- "value":0
- }])JSON")
- {
- inputs.push_back(std::make_shared<Input>("Value", 0));
- outputs.push_back(std::make_shared<Output>("Value", 0));
-
- key = "Parameter";
- setName(key);
- }
- state Parameter::update() {
- return getOutput(0)->setValue(getInput(0)->getValue());
- }
- std::string Parameter::setName(const std::string& name) {
- //inputs[0]->setName(name);
- outputs[0]->setName(name);
- return name;
- }
- std::string Parameter::setAppendix(int appendix)
- {
- inputs[0]->setAppendix(appendix);
- outputs[0]->setAppendix(appendix);
- return ModuleBase::setAppendix(appendix);
- }
- bool Parameter::configureChild(const json& config)
- {
- auto jit = config.find("name");
- if (jit != config.end())
- {
- if (jit.value().get<std::string>() == "appendix")
- {
- setAppendix(jit.value()["value"].get<int>());
- _base_config["configure"]["appendix"]["value"] = getAppendix();
- }
- }
- return false;
- }
- }
|