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()
3505 if(!parsed[
"dt"].is_null()) {
dt = parsed[
"dt"].
number_value(); }
3520 if(!parsed[
"mode"].is_null()) {
mode = parsed[
"mode"].
int_value(); }
3536 if(!parsed[
"vertices"][
i].is_null()) {
vertices[
i].from_json(parsed[
"vertices"][
i].
dump()); }
3539 if(!parsed[
"triangles"][
i].is_null()) {
triangles[
i].from_json(parsed[
"triangles"][
i].
dump()); }
3542 cerr<<
"ERROR = "<<error<<endl;
Vector moi
Definition: jsondef.h:3448
float area
Definition: jsondef.h:3429
Vector fdrag
Definition: jsondef.h:3444
Definition: json11.hpp:79
Vector com
Definition: jsondef.h:3449
Vector gtorque
Definition: jsondef.h:3440
float radiation
Definition: jsondef.h:3428
Vector adrag
Definition: jsondef.h:3445
vector< Vector > vertices
Definition: jsondef.h:3451
int i
Definition: rw_test.cpp:37
Vector thrust
Definition: jsondef.h:3447
float battcap
Definition: jsondef.h:3430
float battlev
Definition: jsondef.h:3431
Vector ftorque
Definition: jsondef.h:3437
double mjddiff
Offset factor for simulated time (simtime = mjdaccel * realtime + mjddiff)
Definition: jsondef.h:3422
double mjdaccel
Acceleration factor for simulated time.
Definition: jsondef.h:3420
float temp
Definition: jsondef.h:3426
float hcap
Definition: jsondef.h:3424
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:783
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
Vector htorque
Definition: jsondef.h:3441
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
Vector rtorque
Definition: jsondef.h:3439
Vector rdrag
Definition: jsondef.h:3446
Vector ctorque
Definition: jsondef.h:3443
Vector atorque
Definition: jsondef.h:3438
Vector hmomentum
Definition: jsondef.h:3442
float powuse
Definition: jsondef.h:3433
float heat
Definition: jsondef.h:3427
float mass
Definition: jsondef.h:3425
double dt
Time step in seconds.
Definition: jsondef.h:3414
int32_t mode
Definition: jsondef.h:3436
double utc
Simulated starting time in MJD.
Definition: jsondef.h:3418
double dtj
Time step in Julian days.
Definition: jsondef.h:3416
int int_value() const
Definition: json11.cpp:281
vector< trianglestruc > triangles
Definition: jsondef.h:3452
float powgen
Definition: jsondef.h:3432
double number_value() const
Definition: json11.cpp:280