COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
pvstrgstruc Struct Reference

PV String (STRG) structure. More...

#include <jsondef.h>

Collaboration diagram for pvstrgstruc:

Public Member Functions

json11::Json to_json () const
 Convert class contents to JSON object. More...
 
void from_json (const string &s)
 Set class contents from JSON string. More...
 

Public Attributes

uint16_t bcidx = 0
 BCREG index. More...
 
float effbase = 0.f
 Efficiency 0th order term. More...
 
float effslope = 0.f
 Efficiency 1st order term. More...
 
float maxpower = 0.f
 Maximum power generation in Watts. More...
 
float power = 0.f
 Current power being generated in Watts. More...
 

Detailed Description

PV String (STRG) structure.

Efficiency is goven as effbase + effslope * Tkelvin.

Member Function Documentation

json11::Json pvstrgstruc::to_json ( ) const
inline

Convert class contents to JSON object.

Returns a json11 JSON object of the class

Returns
A json11 JSON object containing every member variable within the class
2612  {
2613  return json11::Json::object {
2614  { "bcidx" , bcidx },
2615  { "effbase", effbase },
2616  { "effslope", effslope },
2617  { "maxpower", maxpower },
2618  { "power" , power}
2619  };
2620  }
std::map< std::string, Json > object
Definition: json11.hpp:88
float effbase
Efficiency 0th order term.
Definition: jsondef.h:2600
float maxpower
Maximum power generation in Watts.
Definition: jsondef.h:2604
float power
Current power being generated in Watts.
Definition: jsondef.h:2606
float effslope
Efficiency 1st order term.
Definition: jsondef.h:2602
uint16_t bcidx
BCREG index.
Definition: jsondef.h:2598
void pvstrgstruc::from_json ( const string &  s)
inline

Set class contents from JSON string.

Parses the provided JSON-formatted string and sets the class data. String should be formatted like the string returned from to_json()

Parameters
sJSON-formatted string to set class contents to
Returns
n/a
2628  {
2629  string error;
2630  json11::Json parsed = json11::Json::parse(s,error);
2631  if(error.empty()) {
2632  if(!parsed["bcidx"].is_null()) { bcidx = parsed["bcidx"].int_value(); }
2633  if(!parsed["effbase"].is_null()) { effbase = parsed["effbase"].number_value(); }
2634  if(!parsed["effslope"].is_null()) { effslope = parsed["effslope"].number_value(); }
2635  if(!parsed["maxpower"].is_null()) { maxpower = parsed["maxpower"].number_value(); }
2636  if(!parsed["power"].is_null()) { power = parsed["power"].number_value(); }
2637  } else {
2638  cerr<<"ERROR: <"<<error<<">"<<endl;
2639  }
2640  return;
2641  }
Definition: json11.hpp:79
float effbase
Efficiency 0th order term.
Definition: jsondef.h:2600
float maxpower
Maximum power generation in Watts.
Definition: jsondef.h:2604
float power
Current power being generated in Watts.
Definition: jsondef.h:2606
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
float effslope
Efficiency 1st order term.
Definition: jsondef.h:2602
uint16_t bcidx
BCREG index.
Definition: jsondef.h:2598
int int_value() const
Definition: json11.cpp:281
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

uint16_t pvstrgstruc::bcidx = 0

BCREG index.

float pvstrgstruc::effbase = 0.f

Efficiency 0th order term.

float pvstrgstruc::effslope = 0.f

Efficiency 1st order term.

float pvstrgstruc::maxpower = 0.f

Maximum power generation in Watts.

float pvstrgstruc::power = 0.f

Current power being generated in Watts.


The documentation for this struct was generated from the following file: