GConSump/sale: add does not rewrite groups.

This commit is contained in:
Steinar Foss
2019-11-07 10:00:54 +01:00
parent d86ea3cb30
commit a1c5aaa4d4
2 changed files with 2 additions and 2 deletions

View File

@@ -53,7 +53,6 @@ GConSale::MaxProcedure GConSale::stringToProcedure(const std::string& str_proc)
}
void GConSale::add(const std::string& name, const UDAValue& sales_target, const UDAValue& max_rate, const UDAValue& min_rate, const std::string& procedure) {
groups[name] = GCONSALEGroup();
GConSale::GCONSALEGroup& group = groups[name];
group.sales_target = sales_target;
group.max_sales_rate = max_rate;

View File

@@ -37,8 +37,9 @@ const GConSump::GCONSUMPGroup& GConSump::get(const std::string& name) const {
void GConSump::add(const std::string& name, const UDAValue& consumption_rate, const UDAValue& import_rate, const std::string network_node) {
groups[name] = GCONSUMPGroup();
GConSump::GCONSUMPGroup& group = groups[name];
group.consumption_rate = consumption_rate;
group.import_rate = import_rate;
group.network_node = network_node;