nikhilgupta10 / GridLAB-D

Other
1 stars 0 forks source link

#981 gld_property not working correctly with user defined properties of a class, #2707

Closed nikhilgupta10 closed 7 years ago

nikhilgupta10 commented 7 years ago

I was experimenting with gld_property replacing some of the pointers in controller. I noticed that it doesn/u2019t work correctly with user defined properties. For example: In the glm I have this.

class auction { double current_price_mean_24h; double current_price_stdev_24h; }

In the controller code I have something like this gld_property avgProp;// in the header avgProp = gld_property(marketObj, /u201ccurrent_price_mean_24h/u201d); if(!avgProp.is_valid()){ error; } Else { Double avgValue; Do all the stuff with avgProp.getp(avgValue); }

Everything builds fine and the test glm I ran shows no error message indicating avgProp.is_valid() == false. However, I set a recorder to record the avgValue and the value is always zero which is not the case for current_price_mean_24h. I/u2019ve tried executing the avgProp = gld_property(marketObj, /u201ccurrent_price_mean_24h/u201d) line in init, and postsync and still the value is always zero.

Now I used this same process with the native properties of auction and everything works fine. For example the override correction uses this code structure. It/u2019s just with these user defined variables.

Dave suspects it has something to do with setup_class in gldcore/load.c not working properly. I've taken a look at setup_class its basically crudely gutted using an ifdef block. ,

nikhilgupta10 commented 7 years ago

nikhilgupta10 imported these comments from Sourceforge: The user dchassin does not exist anymore. Therefore assigning this to afisher1. "andyfisher":- status: new --> closed