Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Fix RBSA object creation and initialization (#938)
Browse files Browse the repository at this point in the history
Co-authored-by: Alyona Teyber <Ivanova.alyona5@gmail.com>
  • Loading branch information
dchassin and aivanova5 committed Jul 2, 2021
1 parent 7218942 commit b341740
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
21 changes: 19 additions & 2 deletions module/residential/rbsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,25 @@ rbsa::rbsa(MODULE *module)

int rbsa::create(void)
{

memcpy((void*)this,defaults,sizeof(*this));
components = NULL;
voltage_A = NULL;
voltage_B = NULL;
voltage_C = NULL;
nominal_voltage = NULL;
temperature = NULL;
price = NULL;
solar = NULL;
occupancy = NULL;
data = NULL;
power_A = NULL;
power_B = NULL;
power_C = NULL;
current_A = NULL;
current_B = NULL;
current_C = NULL;
shunt_A = NULL;
shunt_B = NULL;
shunt_C = NULL;
return 1;
}

Expand Down
3 changes: 2 additions & 1 deletion module/residential/rbsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class rbsa : public gld_object
SENSITIVITY occupancy; // occupancy sensitivity
struct s_component *next;
} COMPONENT;
COMPONENT *components;
public:
COMPONENT *get_first_component();
inline COMPONENT *get_next_component(COMPONENT *c);
Expand Down Expand Up @@ -144,6 +143,8 @@ class rbsa : public gld_object
else
warning("unable to link property '%s' in object '%s'",name,get_object(obj)->get_name());
}
private:
COMPONENT *components;
private:
complex *voltage_A;
complex *voltage_B;
Expand Down

0 comments on commit b341740

Please sign in to comment.