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

Fix RBSA object creation and initialization #938

Merged
merged 2 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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