COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
jsondef.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
30 #ifndef _JSONDEF_H
31 #define _JSONDEF_H
32 
37 #include "support/configCosmos.h"
38 
39 #include "math/mathlib.h"
40 #include "support/convertdef.h"
41 #include "physics/physicsdef.h"
42 #include "support/socketlib.h"
43 #include "support/objlib.h"
44 
45 
49 
51 //Namespace 1.0
52 enum {
59 };
60 
62 //Namespace 1.0
63 enum {
138 };
139 
141 //Namespace 1.0
142 enum {
176 };
177 
179 //Namespace 1.0
180 enum {
298  JSON_TYPE_NONE=UINT16_MAX
299 };
300 
302 //Namespace 1.0
303 enum class JSON_UPDATE : int32_t {
304  NONE,
305  POS,
306  ATT
307 };
308 
310 //Namespace 1.0
311 enum {
320 };
321 
323 //Namespace 1.0
324 enum {
355 };
356 
357 #define HCAP 800.
358 
359 #define MAREA (.0027)
360 #define MWIDTH .2167
361 #define MHEIGHT .8255
362 #define MRADIUS .2616
363 
364 #define LEO1_BOTTOM 16
365 #define LEO1_TOP 17
366 
368 #define MAXPART 256
369 #define MAXSTRING 20
371 #define MAXBATT 15
373 #define MAXPNT 8
375 #define MAXFACE 20
377 #define MAXCOMP 128
379 #define MAXTRACK 30
381 #define MAXTSEN 64
383 #define MAXSS 2
385 #define MAXIMU 2
387 #define MAXSTT 2
389 #define MAXRW 2
391 #define MAXMTR 3
393 #define MAXCPU 6
395 #define MAXGPS 2
397 #define MAXPLOAD 6
399 #define MAXBUS 40
401 #define MAXPROP 5
403 #define MAXTHST 5
405 #define MAXMOTR 8
407 #define MAXSWCH 2
409 #define MAXANT 5
411 #define MAXTCV 2
413 #define MAXMCC 3
415 #define MAXPLOADKEYCNT 10
417 #define MAXPLOADKEYSIZE COSMOS_MAX_NAME
419 
421 
425 
427 #define JSON_MAX_DATA (COSMOS_MAX_DATA)
428 #define COSMOS_MAX_NAME 40
430 #define JSON_MAX_HASH (COSMOS_MAX_NAME*37)
432 #define JSTRINGMAXBUFFER (AGENTMAXBUFFER-2)
434 #define MAX_COSMOSSTRUC 20
436 
438 #define AGENTMAXBUFFER 60000
439 #define AGENTMAXIF 10
441 #define AGENTMAXBUILTINCOUNT 6
443 #define AGENTMAXUSERCOUNT 200 // 20150629JC: Increased count from 40 to 200 (to support new software)
445 #define AGENTMAXREQUESTCOUNT (AGENTMAXBUILTINCOUNT+AGENTMAXUSERCOUNT)
447 
448 // Maximums for pre-allocated (and never reallocated) vector storage inside cosmosstruc
449 //* Maximum number of vertices - Cube = 14
450 #define MAX_NUMBER_OF_VERTICES 28
451 
452 //* Maximum number of triangles - Cube = 24
453 #define MAX_NUMBER_OF_TRIANGLES 48
454 
455 //* Maximum number of vertices
456 #define MAX_NUMBER_OF_VERTEXS 5
457 
458 //* Maximum number of normals
459 #define MAX_NUMBER_OF_NORMALS 5
460 
461 //* Maximum number of equations
462 #define MAX_NUMBER_OF_EQUATIONS 3
463 
464 //* Maximum number of agents
465 #define MAX_NUMBER_OF_AGENTS 5
466 
467 //* Maximum number of ports
468 #define MAX_NUMBER_OF_PORTS 5
469 
470 //* Maximum number of events
471 #define MAX_NUMBER_OF_EVENTS 10
472 
473 //* Maximum number of targets
474 #define MAX_NUMBER_OF_TARGETS 10
475 
476 //* Maximum number of users
477 #define MAX_NUMBER_OF_USERS 3
478 
479 //* Maximum number of TLES
480 #define MAX_NUMBER_OF_TLES 5
481 
485 
489 
490 enum DeviceType : uint16_t {
492  PLOAD=0,
494  SSEN=1,
496  IMU=2,
498  RW=3,
500  MTR=4,
502  CPU=5,
504  GPS=6,
506  ANT=7,
508  RXR=8,
510  TXR=9,
512  TCV=10,
514  PVSTRG=11,
516  BATT=12,
518  HTR=13,
520  MOTR=14,
522  TSEN=15,
524  THST=16,
526  PROP=17,
528  SWCH=18,
530  ROT=19,
532  STT=20,
534  MCC=21,
536  TCU=22,
538  BUS=23,
540  PSEN=24,
542  SUCHI=25,
544  CAM=26,
546  TELEM=27,
548  DISK=28,
550  TNC=29,
552  BCREG=30,
556  NONE=UINT16_MAX
557 };
558 
559 enum {
569 };
570 
571 enum {
587 };
588 
589 enum {
601  };
602 
603 enum {
613 };
614 
616 
621 #define COMP_MODEL_UNDEFINED 0
622 #define COMP_MODEL_IMU_VN100 1
624 #define COMP_MODEL_IMU_MICROSTRAIN 2
626 #define COMP_MODEL_IMU_HCC 3
628 
633 #define DEVICE_FLAG_OFF 0x0000
634 #define DEVICE_FLAG_ON 0x0001
635 #define DEVICE_FLAG_SIMULATED 0x0002
636 #define DEVICE_FLAG_ACTIVE 0x0004 // TODO: define device active
637 #define DEVICE_FLAG_CONNECTED 0x0008 // TODO: define device connected
638 
644 enum PORT_TYPE {
655  PORT_TYPE_NONE = UINT16_MAX
656 };
657 
660 
664 
666 
672 struct unitstruc
673 {
675  string name = "";
677  uint16_t type = JSON_UNIT_TYPE_IDENTITY;
679  float p0 = 0.f;
681  float p1 = 0.f;
683  float p2 = 0.f;
684 
686 
690  return json11::Json::object {
691  { "name", name },
692  { "type", type },
693  { "p0", p0 },
694  { "p1", p1 },
695  { "p2", p2 }
696  };
697  }
698 
700 
705  void from_json(const string& s) {
706  string error;
707  json11::Json parsed = json11::Json::parse(s,error);
708  if(error.empty()) {
709  if(!parsed["name"].is_null()) { name = parsed["name"].string_value(); }
710  if(!parsed["type"].is_null()) { type = parsed["type"].int_value(); }
711  if(!parsed["p0"].is_null()) { p0 = parsed["p0"].number_value(); }
712  if(!parsed["p1"].is_null()) { p1 = parsed["p1"].number_value(); }
713  if(!parsed["p2"].is_null()) { p2 = parsed["p2"].number_value(); }
714  } else {
715  cerr<<"ERROR: <"<<error<<">"<<endl;
716  }
717  return;
718  }
719 };
720 
724 struct jsonnode
725 {
726  string name = "";
727  string node = "";
728  string state = "";
729  string utcstart = "";
730  string vertexs = "";
731  string faces = "";
732  string pieces = "";
733  string devgen = "";
734  string devspec = "";
735  string ports = "";
736  string targets = "";
737 
739 
743  return json11::Json::object {
744  { "name" , name },
745  { "node" , node },
746  { "state" , state },
747  { "utcstart" , utcstart },
748  { "vertexs" , vertexs },
749  { "faces" , faces },
750  { "pieces" , pieces },
751  { "devgen" , devgen },
752  { "devspec" , devspec },
753  { "ports" , ports },
754  { "targets" , targets },
755  };
756  }
757 
759 
764  void from_json(const string& s) {
765  string error;
766  json11::Json parsed = json11::Json::parse(s,error);
767  if(error.empty()) {
768  if(!parsed["name"].is_null()) { name = parsed["name"].string_value(); }
769  if(!parsed["node"].is_null()) { node = parsed["node"].string_value(); }
770  if(!parsed["state"].is_null()) { state = parsed["state"].string_value(); }
771  if(!parsed["utcstart"].is_null()) { utcstart = parsed["utcstart"].string_value(); }
772  if(!parsed["vertexs"].is_null()) { vertexs = parsed["vertexs"].string_value(); }
773  if(!parsed["faces"].is_null()) { faces = parsed["faces"].string_value(); }
774  if(!parsed["pieces"].is_null()) { pieces = parsed["pieces"].string_value(); }
775  if(!parsed["devgen"].is_null()) { devgen = parsed["devgen"].string_value(); }
776  if(!parsed["devspec"].is_null()) { devspec = parsed["devspec"].string_value(); }
777  if(!parsed["ports"].is_null()) { ports = parsed["ports"].string_value(); }
778  if(!parsed["targets"].is_null()) { targets = parsed["targets"].string_value(); }
779  } else {
780  cerr<<"ERROR: <"<<error<<">"<<endl;
781  }
782  return;
783  }
784 };
785 
787 
790 //Namespace 1.0
792 {
793  // Hash of equation or name
794  uint16_t hash; // NOTE: Initializing this
795  // Index within that hash entry
796  uint16_t index;
797 
799 
803  return json11::Json::object {
804  { "hash" , hash },
805  { "index", index }
806  };
807  }
808 
810 
815  void from_json(const string& s) {
816  string error;
818  if(error.empty()) {
819  if(!p["hash"].is_null()) { hash = p["hash"].int_value(); }
820  if(!p["index"].is_null()) { index = p["index"].int_value(); }
821  } else {
822  cerr<<"ERROR: <"<<error<<">"<<endl;
823  }
824  return;
825  }
826 };
827 
829 
832 //Namespace 1.0
833 struct jsontoken
834 {
836  string value;
837  double utc;
838 };
839 
841 
845 //Namespace 1.0
847 {
849  uint16_t type;
851  union
852  {
853  double value;
855  };
856 };
857 
859 
864 //Namespace 1.0
866 {
868  char *text;
870  uint16_t unit_index;
872  uint16_t operation;
874  jsonoperand operand[2];
875 };
876 
879 typedef int32_t (*agent_request_function)(char* request_string, char* output_string, void *root);
880 
884 {
886  string token;
889  string synopsis;
890  string description;
891 };
892 
896 {
897  // Channel type
898  int32_t type;
899  // Channel UDP socket handle
900  int32_t cudp;
901  // Channel UDP INET4 address
902  struct sockaddr_in caddr;
903  // Channel UDP INET4 broadcast address
904  struct sockaddr_in baddr;
905  // Channel UDP INET6 address
906  struct sockaddr_in6 caddr6;
907  // Length for chosen address
908  int addrlen;
909  // Channel port
910  uint16_t cport;
911  // Channel's maximum message size
912  uint16_t msgsize;
913  // Channel's protocol address in string form
914  char address[18];
915  // Channel's broadcast address in string form
916  char baddress[18];
917  // Channel's interface name
919 };
920 
923 struct beatstruc
924 {
926  double utc = 0.;
928  char node[COSMOS_MAX_NAME+1] = {}; // TODO: change to string
930  char proc[COSMOS_MAX_NAME+1] = {}; // TODO: change to string
931  // Type of address protocol
934  char addr[18] = {};
936  uint16_t port = 0;
938  uint32_t bsz = 0;
940  double bprd = 0.;
942  char user[COSMOS_MAX_NAME+1] = {};
944  float cpu = 0.;
946  float memory = 0.;
948  double jitter = 0.;
950  bool exists = true;
951 
953 
957  return json11::Json::object {
958  { "utc" , utc },
959  { "node" , node },
960  { "proc" , proc },
961  { "ntype" , static_cast<int>(ntype) },
962  { "addr" , addr },
963  { "port" , port },
964  { "bsz" , static_cast<int>(bsz) },
965  { "bprd" , bprd },
966  { "user" , user },
967  { "cpu" , cpu },
968  { "memory", memory },
969  { "jitter", jitter },
970  { "exists", exists }
971  };
972  }
973 
975 
980  void from_json(const string& s) {
981  string error;
983  if(error.empty()) {
984  if(!p["utc"].is_null()) { utc = p["utc"].number_value(); }
985  if(!p["node"].is_null()) { strcpy(node, p["node"].string_value().c_str()); }
986  if(!p["proc"].is_null()) { strcpy(proc, p["proc"].string_value().c_str()); }
987  if(!p["ntype"].is_null()) { ntype = static_cast<NetworkType>(p["ntype"].int_value()); }
988  if(!p["addr"].is_null()) { strcpy(addr, p["addr"].string_value().c_str()); }
989  if(!p["port"].is_null()) { port = p["port"].int_value(); }
990  if(!p["bsz"].is_null()) { bsz = p["bsz"].int_value(); }
991  if(!p["bprd"].is_null()) { bprd = p["bprd"].number_value(); }
992  if(!p["user"].is_null()) { strcpy(user, p["user"].string_value().c_str()); }
993  if(!p["cpu"].is_null()) { cpu = p["cpu"].number_value(); }
994  if(!p["memory"].is_null()) { memory = p["memory"].number_value(); }
995  if(!p["jitter"].is_null()) { jitter = p["jitter"].number_value(); }
996  if(!p["exists"].is_null()) { exists = p["exists"].bool_value(); }
997  } else {
998  cerr<<"ERROR: <"<<error<<">"<<endl;
999  }
1000  return;
1001  }
1002 };
1003 
1005 // JIMNOTE: take a look at this mess
1007 {
1009  bool client = true;
1013  bool server = true;
1015  size_t ifcnt = 0;
1021  int32_t pid = 0;
1023  double aprd = 0.;
1025  uint16_t stateflag = 0;
1027  vector <agent_request_entry> reqs;
1030 
1032 
1036 // vector<uint16_t> v_pub = vector<uint16_t>(pub, pub+AGENTMAXIF);
1037  return json11::Json::object {
1038  { "client" , client },
1039 //TODO? { "sub" , sub },
1040  { "server" , server },
1041  { "ifcnt" , static_cast<int>(ifcnt) },
1042 // { "pub" , v_pub },
1043 // { "req" , req },
1044  { "pid" , pid },
1045  { "aprd" , aprd },
1046  { "stateflag" , stateflag },
1047 // { "reqs" , reqs },
1048  { "beat" , beat }
1049  };
1050  }
1051 
1053 
1058  void from_json(const string& s) {
1059  string error;
1060  json11::Json p = json11::Json::parse(s,error);
1061  if(error.empty()) {
1062  if(!p["client"].is_null()) { client = p["client"].bool_value(); }
1063 //TODO? if(!p["sub"].is_null()) sub.from_json(p["sub"].dump());
1064  if(!p["server"].is_null()) { server = p["server"].bool_value(); }
1065  if(!p["ifcnt"].is_null()) { ifcnt = static_cast<size_t>(p["ifcnt"].number_value()); }
1066  auto p_pub = p["pub"].array_items();
1067 // if(!p["pub"].is_null()) {
1068 // for(size_t i = 0; i < p_pub.size(); ++i) {
1069 // if(!p["pub"][i].is_null()) pub[i].from_json(p["pub"][i].dump());
1070 // }
1071 // }
1072 // if(!p["req"].is_null()) req.from_json(p["req"].dump());
1073  if(!p["pid"].is_null()) { pid = p["pid"].int_value(); }
1074  if(!p["aprd"].is_null()) { aprd = p["aprd"].number_value(); }
1075  if(!p["stateflag"].is_null()) { stateflag = p["stateflag"].int_value(); }
1076 // if(!p["reqs"].is_null()) {
1077 // for(size_t i = 0; i < reqs.size(); ++i) {
1078 // if(!p["reqs"][i].is_null()) reqs[i].from_json(p["reqs"][i].dump());
1079 // }
1080 // }
1081  if(!p["beat"].is_null()) { beat.from_json(p["beat"].dump()); }
1082  } else {
1083  cerr<<"ERROR: <"<<error<<">"<<endl;
1084  }
1085  return;
1086  }
1087 };
1088 
1090 
1094 {
1096  double utc = 0.; //TODO: replace for mjd
1098  double utcexec = 0.;
1100  char node[COSMOS_MAX_NAME+1] = "";
1102  // TODO: change char to string
1103  char name[COSMOS_MAX_NAME+1] = "";
1105  char user[COSMOS_MAX_NAME+1] = "";
1107  uint32_t flag = 0;
1109  uint32_t type = 0;
1111  double value = 0.;
1113  double dtime = 0.;
1115  double ctime = 0.;
1117  float denergy = 0.f;
1119  float cenergy = 0.f;
1121  float dmass = 0.f;
1123  float cmass = 0.f;
1125  float dbytes = 0.f;
1127  float cbytes = 0.f;
1131  char data[JSON_MAX_DATA] = "";
1133  char condition[JSON_MAX_DATA] = "";
1134 
1136 
1140  return json11::Json::object {
1141  { "utc" , utc },
1142  { "utcexec" , utcexec },
1143  { "node" , node },
1144  { "name" , name },
1145  { "user" , user },
1146  { "flag" , static_cast<int>(flag) },
1147  { "type" , static_cast<int>(type) },
1148  { "value" , value },
1149  { "dtime" , dtime },
1150  { "ctime" , ctime },
1151  { "denergy" , denergy },
1152  { "cenergy" , cenergy },
1153  { "dmass" , dmass },
1154  { "cmass" , cmass },
1155  { "dbytes" , dbytes },
1156  { "cbytes" , cbytes },
1157  { "handle" , handle },
1158  { "data" , data },
1159  { "condition" , condition }
1160  };
1161  }
1162 
1164 
1169  void from_json(const string& s) {
1170  string error;
1171  json11::Json p = json11::Json::parse(s,error);
1172  if(error.empty()) {
1173  if(!p["utc"].is_null()) { utc = p["utc"].number_value(); }
1174  if(!p["utcexec"].is_null()) { utcexec = p["utcexec"].number_value(); }
1175  if(!p["node"].is_null()) { strcpy(node, p["node"].string_value().c_str()); }
1176  if(!p["name"].is_null()) { strcpy(name, p["name"].string_value().c_str()); }
1177  if(!p["user"].is_null()) { strcpy(user, p["user"].string_value().c_str()); }
1178  if(!p["flag"].is_null()) { flag = p["flag"].int_value(); }
1179  if(!p["type"].is_null()) { type = p["type"].int_value(); }
1180  if(!p["value"].is_null()) { value = p["value"].number_value(); }
1181  if(!p["dtime"].is_null()) { dtime = p["dtime"].number_value(); }
1182  if(!p["ctime"].is_null()) { ctime = p["ctime"].number_value(); }
1183  if(!p["denergy"].is_null()) { denergy = p["denergy"].number_value(); }
1184  if(!p["cenergy"].is_null()) { cenergy = p["cenergy"].number_value(); }
1185  if(!p["dmass"].is_null()) { dmass = p["dmass"].number_value(); }
1186  if(!p["cmass"].is_null()) { cmass = p["cmass"].number_value(); }
1187  if(!p["dbytes"].is_null()) { dbytes = p["dbytes"].number_value(); }
1188  if(!p["cbytes"].is_null()) { cbytes = p["cbytes"].number_value(); }
1189  if(!p["handle"].is_null()) { handle.from_json(p["handle"].dump()); }
1190  if(!p["data"].is_null()) { strcpy(data, p["data"].string_value().c_str()); }
1191  if(!p["condition"].is_null()) { strcpy(condition, p["condition"].string_value().c_str()); }
1192  } else {
1193  cerr<<"ERROR: <"<<error<<">"<<endl;
1194  }
1195  return;
1196  }
1197 };
1198 
1200 {
1201  //to enforce a std::string name length maximum (if necessary) use this code to truncate:
1202  //
1203  //constexpr std::string::size_type MAX_CHARS = 20 ;
1204  //if(whatever_string.size() > MAX_CHARS) {
1205  // whatever_string = whatever_string.substr(0, MAX_CHARS);
1206  //}
1207  string name = "";
1208  string node = "";
1209  string tool = "";
1210  string cpu = "";
1211 
1213 
1217  return json11::Json::object {
1218  { "name" , name },
1219  { "node", node },
1220  { "tool", tool },
1221  { "cpu", cpu }
1222  };
1223  }
1224 
1226 
1231  void from_json(const string& s) {
1232  string error;
1233  json11::Json parsed = json11::Json::parse(s,error);
1234  if(error.empty()) {
1235  if(!parsed["name"].is_null()) { name = parsed["name"].string_value(); }
1236  if(!parsed["node"].is_null()) { node = parsed["node"].string_value(); }
1237  if(!parsed["tool"].is_null()) { tool = parsed["tool"].string_value(); }
1238  if(!parsed["cpu"].is_null()) { cpu = parsed["cpu"].string_value(); }
1239  } else {
1240  cerr<<"ERROR: <"<<error<<">"<<endl;
1241  }
1242  return;
1243  }
1244 };
1245 
1247 
1250 {
1251  // Equation name
1252  string name;
1253  // Equation string
1254  string value;
1255 
1257 
1261  return json11::Json::object {
1262  { "name" , name },
1263  { "value", value }
1264  };
1265  }
1266 
1268 
1273  void from_json(const string& s) {
1274  string error;
1275  json11::Json parsed = json11::Json::parse(s,error);
1276  if(error.empty()) {
1277  if(!parsed["name"].is_null()) { name = parsed["name"].string_value(); }
1278  if(!parsed["value"].is_null()) { value = parsed["value"].string_value(); }
1279  } else {
1280  cerr<<"ERROR: <"<<error<<">"<<endl;
1281  }
1282  return;
1283  }
1284 };
1285 
1286 
1288 
1291 {
1292  double utc = 0.;
1293  char name[COSMOS_MAX_NAME+1] = "";
1294  uint16_t type = 0;
1295  float azfrom = 0.f;
1296  float elfrom = 0.f;
1297  float azto = 0.f;
1298  float elto = 0.f;
1299  double range = 0.;
1300  double close = 0.;
1301  float min = 0.f;
1303 
1305 
1309  return json11::Json::object {
1310  { "utc" , utc },
1311  { "name" , name },
1312  { "type" , type },
1313  { "azfrom" , azfrom },
1314  { "elfrom" , elfrom },
1315  { "azto" , azto },
1316  { "elto" , elto },
1317  { "range" , range },
1318  { "close" , close },
1319  { "min" , min },
1320  { "loc" , loc }
1321  };
1322  }
1323 
1325 
1330  void from_json(const string& s) {
1331  string error;
1332  json11::Json p = json11::Json::parse(s,error);
1333  if(error.empty()) {
1334  if(!p["utc"].is_null()) { utc = p["utc"].number_value(); }
1335  if(!p["name"].is_null()) { strcpy(name, p["name"].string_value().c_str()); }
1336  if(!p["type"].is_null()) { type = p["type"].int_value(); }
1337  if(!p["azfrom"].is_null()) { azfrom = p["azfrom"].number_value(); }
1338  if(!p["elfrom"].is_null()) { elfrom = p["elfrom"].number_value(); }
1339  if(!p["azto"].is_null()) { azto = p["azto"].number_value(); }
1340  if(!p["elto"].is_null()) { elto = p["elto"].number_value(); }
1341  if(!p["range"].is_null()) { range = p["range"].number_value(); }
1342  if(!p["close"].is_null()) { close = p["close"].number_value(); }
1343  if(!p["min"].is_null()) { min = p["min"].number_value(); }
1344  if(!p["loc"].is_null()) { loc.from_json(p["loc"].dump()); }
1345  } else {
1346  cerr<<"ERROR: <"<<error<<">"<<endl;
1347  }
1348  return;
1349  }
1350 };
1351 
1353 
1358 {
1363  char name[COSMOS_MAX_DATA+1] = "";
1364 
1366 
1370  return json11::Json::object {
1371  { "type" , type },
1372  { "name" , name }
1373  };
1374  }
1375 
1377 
1382  void from_json(const string& s) {
1383  string error;
1384  json11::Json p = json11::Json::parse(s,error);
1385  if(error.empty()) {
1386  if(!p["type"].is_null()) { type = static_cast<PORT_TYPE>(p["type"].int_value()); }
1387  if(!p["name"].is_null()) { strcpy(name, p["name"].string_value().c_str()); }
1388  } else {
1389  cerr<<"ERROR: <"<<error<<">"<<endl;
1390  }
1391  return;
1392  }
1393 };
1394 
1397 
1400 {
1401  uint16_t vertex_cnt = 0;
1402  vector <uint16_t> vertex_idx;
1405  double area=0.;
1406 
1408 
1412  return json11::Json::object {
1413  { "vertex_cnt" , vertex_cnt},
1414  { "vertex_idx" , vertex_idx },
1415  { "com" , com },
1416  { "normal" , normal },
1417  { "area" , area }
1418  };
1419  }
1420 
1422 
1427  void from_json(const string& s) {
1428  string error;
1429  json11::Json parsed = json11::Json::parse(s,error);
1430  if(error.empty()) {
1431  if(!parsed["vertex_cnt"].is_null()) { vertex_cnt = parsed["vertex_cnt"].int_value(); }
1432  for(size_t i = 0; i < vertex_idx.size(); ++i) {
1433  if(!parsed["vertex_idx"][i].is_null()) { vertex_idx[i] = parsed["vertex_idx"][i].int_value(); }
1434  }
1435  if(!parsed["com"].is_null()) { com.from_json(parsed["com"].dump()); }
1436  if(!parsed["normal"].is_null()) { normal.from_json(parsed["normal"].dump()); }
1437  if(!parsed["area"].is_null()) { area = parsed["area"].number_value(); }
1438  } else {
1439  cerr<<"ERROR: <"<<error<<">"<<endl;
1440  }
1441  return;
1442  }
1443 };
1444 
1447 {
1449  char name[COSMOS_MAX_NAME+1] = "";
1451  bool enabled = true;
1453  uint16_t cidx = 0;
1455  float density = 0.f;
1457  float mass = 0.f;
1459  float emi = 0.f;
1461  float abs = 0.f;
1463  float hcap = 0.f;
1465  float hcon = 0.f;
1467  float dim = 0.f;
1469  float area = 0.f;
1471  float volume = 0.f;
1473  uint16_t face_cnt = 0;
1475  vector <uint16_t> face_idx;
1483  float heat = 0.f;
1485  float temp = 0.f;
1487  float insol = 0.f;
1489  float material_density = 0.f;
1496 
1498 
1502  return json11::Json::object {
1503  { "name" , name },
1504  { "enabled" , enabled },
1505  { "cidx" , cidx },
1506  { "density" , density },
1507  { "mass" , mass },
1508  { "emi" , emi },
1509  { "abs" , abs },
1510  { "hcap" , hcap },
1511  { "hcon" , hcon },
1512  { "dim" , dim },
1513  { "area" , area },
1514  { "volume" , volume },
1515  { "face_cnt", face_cnt },
1516  { "face_idx", face_idx },
1517  { "com" , com },
1518  { "shove" , shove },
1519  { "twist" , twist },
1520  { "heat" , heat },
1521  { "temp" , temp },
1522  { "insol" , insol },
1523  { "material_density" , material_density },
1524  { "material_ambient" , material_ambient },
1525  { "material_diffuse" , material_diffuse },
1526  { "material_specular", material_specular }
1527  };
1528  }
1529 
1531 
1536  void from_json(const string& s) {
1537  string error;
1538  json11::Json p = json11::Json::parse(s,error);
1539  if(error.empty()) {
1540  if(!p["name"].is_null()) { strcpy(name, p["name"].string_value().c_str()); }
1541  if(!p["enabled"].is_null()) { enabled = p["enabled"].bool_value(); }
1542  if(!p["cidx"].is_null()) { cidx = p["cidx"].int_value(); }
1543  if(!p["density"].is_null()) { density = p["density"].number_value(); }
1544  if(!p["mass"].is_null()) { mass = p["mass"].number_value(); }
1545  if(!p["emi"].is_null()) { emi = p["emi"].number_value(); }
1546  if(!p["abs"].is_null()) { abs = p["abs"].number_value(); }
1547  if(!p["hcap"].is_null()) { hcap = p["hcap"].number_value(); }
1548  if(!p["hcon"].is_null()) { hcon = p["hcon"].number_value(); }
1549  if(!p["dim"].is_null()) { dim = p["dim"].number_value(); }
1550  if(!p["area"].is_null()) { area = p["area"].number_value(); }
1551  if(!p["volume"].is_null()) { volume = p["volume"].number_value(); }
1552  if(!p["face_cnt"].is_null()) { face_cnt = p["face_cnt"].int_value(); }
1553  if(!p["face_idx"].is_null()) {
1554  auto p_face_idx = p["face_idx"].array_items();
1555  for(size_t i = 0; i != p_face_idx.size(); ++i) {
1556  if(!p_face_idx[i].is_null()) { face_idx[i] = p_face_idx[i].int_value(); }
1557  }
1558  }
1559  if(!p["com"].is_null()) { com.from_json(p["com"].dump()); }
1560  if(!p["shove"].is_null()) { shove.from_json(p["shove"].dump()); }
1561  if(!p["twist"].is_null()) { twist.from_json(p["twist"].dump()); }
1562  if(!p["heat"].is_null()) { heat = p["heat"].number_value(); }
1563  if(!p["temp"].is_null()) { temp = p["temp"].number_value(); }
1564  if(!p["insol"].is_null()) { insol = p["insol"].number_value(); }
1565  if(!p["material_density"].is_null()) { material_density = p["material_density"].number_value(); }
1566  if(!p["material_ambient"].is_null()) { material_ambient.from_json(p["material_ambient"].dump()); }
1567  if(!p["material_diffuse"].is_null()) { material_diffuse.from_json(p["material_diffuse"].dump()); }
1568  if(!p["material_specular"].is_null()) { material_specular.from_json(p["material_specular"].dump()); }
1569  }
1570  return;
1571  }
1572 };
1573 
1574 // Beginning of Device General structures
1575 
1577 
1582 struct allstruc
1583 {
1585  bool enabled = true;
1587  uint16_t type = 0;
1589  uint16_t model = 0;
1591  uint32_t flag = 0;
1593  uint16_t addr = 0;
1595  uint16_t cidx = 0;
1597  uint16_t didx = 0;
1599  uint16_t pidx = 0;
1601  uint16_t bidx = 0;
1603  uint16_t portidx = 0; // TODO: rename to port_id or port_index
1605  float namp = 0.f; // TODO: rename to nominal current
1607  float nvolt = 0.f; // TODO: rename to nominal voltage
1609  float amp = 0.f; // TODO: rename to current
1611  float volt = 0.f; // TODO: rename to voltage
1613  float power = 0.f; // TODO: rename to voltage
1615  float energy = 0.f;
1617  float drate = 0.f;
1619  float temp = 0.f; // TODO: rename to temperature
1621  double utc = 0.;
1622 
1624 
1628  return json11::Json::object {
1629  { "enabled" , enabled },
1630  { "type" , type },
1631  { "model" , model },
1632  { "flag" , static_cast<int>(flag) },
1633  { "addr" , addr },
1634  { "cidx" , cidx },
1635  { "didx" , didx },
1636  { "pidx" , pidx },
1637  { "bidx" , bidx },
1638  { "portidx" , portidx },
1639  { "namp" , namp},
1640  { "nvolt" , nvolt },
1641  { "amp" , amp },
1642  { "volt" , volt },
1643  { "power" , power },
1644  { "energy" , energy },
1645  { "drate" , drate },
1646  { "temp" , temp },
1647  { "utc" , utc },
1648  };
1649  }
1650 
1652 
1657  void from_json(const string& s) {
1658  string error;
1659  json11::Json parsed = json11::Json::parse(s,error);
1660  if(error.empty()) {
1661  if(!parsed["enabled"].is_null()) { enabled = parsed["enabled"].bool_value(); }
1662  if(!parsed["type"].is_null()) { type = parsed["type"].int_value(); }
1663  if(!parsed["model"].is_null()) { model = parsed["model"].int_value(); }
1664  if(!parsed["flag"].is_null()) { flag = parsed["flag"].int_value(); }
1665  if(!parsed["addr"].is_null()) { addr = parsed["addr"].int_value(); }
1666  if(!parsed["cidx"].is_null()) { cidx = parsed["cidx"].int_value(); }
1667  if(!parsed["didx"].is_null()) { didx = parsed["didx"].int_value(); }
1668  if(!parsed["pidx"].is_null()) { pidx = parsed["pidx"].int_value(); }
1669  if(!parsed["bidx"].is_null()) { bidx = parsed["bidx"].int_value(); }
1670  if(!parsed["portidx"].is_null()) { portidx = parsed["portidx"].int_value(); }
1671  if(!parsed["namp"].is_null()) { namp = parsed["namp"].number_value(); }
1672  if(!parsed["nvolt"].is_null()) { nvolt = parsed["nvolt"].number_value(); }
1673  if(!parsed["amp"].is_null()) { amp = parsed["amp"].number_value(); }
1674  if(!parsed["volt"].is_null()) { volt = parsed["volt"].number_value(); }
1675  if(!parsed["power"].is_null()) { power = parsed["power"].number_value(); }
1676  if(!parsed["energy"].is_null()) { energy = parsed["energy"].number_value(); }
1677  if(!parsed["drate"].is_null()) { drate = parsed["drate"].number_value(); }
1678  if(!parsed["temp"].is_null()) { temp = parsed["temp"].number_value(); }
1679  if(!parsed["utc"].is_null()) { utc = parsed["utc"].number_value(); }
1680  } else {
1681  cerr<<"ERROR: <"<<error<<">"<<endl;
1682  }
1683  return;
1684  }
1685 };
1686 
1687 // End of Device General structures
1688 
1689 // Beginning of Device Specific structures
1690 
1692 
1698  //JIMNOTE: this one needs some JSON work... hmm.... what to do about that union....
1700 {
1702  uint16_t type = 0;
1704  //union
1705  //{
1706  uint8_t vuint8 = 0;
1707  int8_t vint8 = 0;
1708  uint16_t vuint16 = 0;
1709  int16_t vint16 = 0;
1710  uint32_t vuint32 = 0;
1711  int32_t vint32 = 0;
1712  float vfloat = 0.f;
1713  double vdouble = 0.f;
1714  char vstring[COSMOS_MAX_NAME+1] = "";
1715  //};
1716 
1718 
1722  return json11::Json::object {
1723  { "type" , type },
1724  { "vstring", vstring }
1725  };
1726  }
1727 
1729 
1734  void from_json(const string& s) {
1735  string error;
1736  json11::Json parsed = json11::Json::parse(s,error);
1737  if(error.empty()) {
1738  if(!parsed["type"].is_null()) { type = parsed["type"].number_value(); }
1739 // TODO: vstring = parsed["vstring"].string_value();
1740  } else {
1741  cerr<<"ERROR: <"<<error<<">"<<endl;
1742  }
1743  return;
1744  }
1745 } ;
1746 
1748 
1753 {
1755  uint16_t key_cnt = 0;
1757  uint16_t keyidx[MAXPLOADKEYCNT] = {0};
1759  float keyval[MAXPLOADKEYCNT] = {0.f};
1760 
1762 
1766  vector<uint16_t> v_keyidx = vector<uint16_t>(keyidx, keyidx+MAXPLOADKEYCNT);
1767  vector<float> v_keyval = vector<float>(keyval, keyval+MAXPLOADKEYCNT);
1768  return json11::Json::object {
1769  { "key_cnt", key_cnt },
1770  { "keyidx" , v_keyidx },
1771  { "keyval" , v_keyval }
1772  };
1773  }
1774 
1776 
1781  void from_json(const string& s) {
1782  string error;
1783  json11::Json parsed = json11::Json::parse(s,error);
1784  if(error.empty()) {
1785  if(!parsed["key_cnt"].is_null()) { key_cnt = parsed["key_cnt"].number_value(); }
1786  if(!parsed["keyidx"].is_null()) {
1787  auto p_keyidx = parsed["keyidx"].array_items();
1788  for(size_t i = 0; i != p_keyidx.size(); ++i) {
1789  if(!parsed["keyidx"][i].is_null()) { keyidx[i] = p_keyidx[i].int_value(); }
1790  }
1791  }
1792  if(!parsed["keyval"].is_null()) {
1793  auto p_keyval = parsed["keyval"].array_items();
1794  for(size_t i = 0; i != p_keyval.size(); ++i) {
1795  if(!parsed["keyval"][i].is_null()) { keyval[i] = p_keyval[i].number_value(); }
1796  }
1797  }
1798  } else {
1799  cerr<<"ERROR: <"<<error<<">"<<endl;
1800  }
1801  return;
1802  }
1803 };
1804 
1807 {
1810  float qva = 0.f;
1811  float qvb = 0.f;
1812  float qvc = 0.f;
1813  float qvd = 0.f;
1814  float azimuth = 0.f;
1815  float elevation = 0.f;
1816 
1818 
1822  return json11::Json::object {
1823  { "align" , align },
1824  { "qva", qva },
1825  { "qvb", qvb },
1826  { "qvc", qvc },
1827  { "qvd", qvd },
1828  { "azimuth", azimuth },
1829  { "elevation", elevation },
1830  };
1831  }
1832 
1834 
1839  void from_json(const string& s) {
1840  string error;
1841  json11::Json parsed = json11::Json::parse(s,error);
1842  if(error.empty()) {
1843  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
1844  if(!parsed["qva"].is_null()) { qva = parsed["qva"].number_value(); }
1845  if(!parsed["qvb"].is_null()) { qvb = parsed["qvb"].number_value(); }
1846  if(!parsed["qvc"].is_null()) { qvc = parsed["qvc"].number_value(); }
1847  if(!parsed["qvd"].is_null()) { qvd = parsed["qvd"].number_value(); }
1848  if(!parsed["azimuth"].is_null()) { azimuth = parsed["azimuth"].number_value(); }
1849  if(!parsed["elevation"].is_null()) { elevation = parsed["elevation"].number_value(); }
1850  } else {
1851  cerr<<"ERROR: <"<<error<<">"<<endl;
1852  }
1853  return;
1854  }
1855 };
1856 
1858 struct imustruc
1859 {
1876 
1878 
1882  return json11::Json::object {
1883  { "align" , align },
1884  { "accel" , accel },
1885  { "theta" , theta },
1886  { "euler" , euler },
1887  { "omega" , omega },
1888  { "alpha" , alpha },
1889  { "mag" , mag },
1890  { "bdot" , bdot }
1891  };
1892  }
1893 
1895 
1900  void from_json(const string& s) {
1901  string error;
1902  json11::Json parsed = json11::Json::parse(s,error);
1903  if(error.empty()) {
1904  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
1905  if(!parsed["accel"].is_null()) { accel.from_json(parsed["accel"].dump()); }
1906  if(!parsed["theta"].is_null()) { theta.from_json(parsed["theta"].dump()); }
1907  if(!parsed["euler"].is_null()) { euler.from_json(parsed["euler"].dump()); }
1908  if(!parsed["omega"].is_null()) { omega.from_json(parsed["omega"].dump()); }
1909  if(!parsed["alpha"].is_null()) { alpha.from_json(parsed["alpha"].dump()); }
1910  if(!parsed["mag"].is_null()) { mag.from_json(parsed["mag"].dump()); }
1911  if(!parsed["bdot"].is_null()) { bdot.from_json(parsed["bdot"].dump()); }
1912  } else {
1913  cerr<<"ERROR: <"<<error<<">"<<endl;
1914  }
1915  return;
1916  }
1917 };
1918 
1920 struct rwstruc
1921 {
1927  float mxomg = 0.f;
1929  float mxalp = 0.f;
1931  float tc = 0.f;
1933  float omg = 0.f;
1935  float alp = 0.f;
1937  float romg = 0.f;
1939  float ralp = 0.f;
1940 
1942 
1946  return json11::Json::object {
1947  { "align" , align },
1948  { "mom" , mom },
1949  { "mxomg" , mxomg },
1950  { "mxalp" , mxalp },
1951  { "tc" , tc },
1952  { "omg" , omg },
1953  { "alp" , alp },
1954  { "romg" , romg },
1955  { "ralp" , ralp },
1956  };
1957  }
1958 
1960 
1965  void from_json(const string& s) {
1966  string error;
1967  json11::Json parsed = json11::Json::parse(s,error);
1968  if(error.empty()) {
1969  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
1970  if(!parsed["mom"].is_null()) { mom.from_json(parsed["mom"].dump()); }
1971  if(!parsed["mxomg"].is_null()) { mxomg = parsed["mxomg"].number_value(); }
1972  if(!parsed["bdmxalpot"].is_null()) { mxalp = parsed["mxalp"].number_value(); }
1973  if(!parsed["tc"].is_null()) { tc = parsed["tc"].number_value(); }
1974  if(!parsed["omg"].is_null()) { omg = parsed["omg"].number_value(); }
1975  if(!parsed["alp"].is_null()) { alp = parsed["alp"].number_value(); }
1976  if(!parsed["romg"].is_null()) { romg = parsed["romg"].number_value(); }
1977  if(!parsed["ralp"].is_null()) { ralp = parsed["ralp"].number_value(); }
1978  } else {
1979  cerr<<"ERROR: <"<<error<<">"<<endl;
1980  }
1981  return;
1982  }
1983 };
1984 
1986 struct mtrstruc
1987 {
1991  float npoly[7] = {0.f};
1993  float ppoly[7] = {0.f};
1995  float mxmom = 0.f;
1997  float tc = 0.f;
1999  float rmom = 0.f;
2001  float mom = 0.f;
2002 
2004 
2008  vector<float> v_npoly = vector<float>(npoly, npoly+sizeof(npoly)/sizeof(npoly[0]));
2009  vector<float> v_ppoly = vector<float>(ppoly, npoly+sizeof(ppoly)/sizeof(ppoly[0]));
2010  return json11::Json::object {
2011  { "align" , align },
2012  { "npoly" , v_npoly },
2013  { "ppoly" , v_ppoly },
2014  { "mxmom" , mxmom },
2015  { "tc" , tc },
2016  { "rmom" , rmom },
2017  { "mom" , mom }
2018  };
2019  }
2020 
2022 
2027  void from_json(const string& s) {
2028  string error;
2029  json11::Json parsed = json11::Json::parse(s,error);
2030  if(error.empty()) {
2031  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
2032  if(!parsed["npoly"].is_null()) {
2033  auto p_npoly = parsed["npoly"].array_items();
2034  for(size_t i = 0; i != p_npoly.size(); ++i) {
2035  if(!p_npoly[i].is_null()) { npoly[i] = p_npoly[i].number_value(); }
2036  }
2037  }
2038  if(!parsed["ppoly"].is_null()) {
2039  auto p_ppoly = parsed["ppoly"].array_items();
2040  for(size_t i = 0; i != p_ppoly.size(); ++i) {
2041  if(!p_ppoly[i].is_null()) { ppoly[i] = p_ppoly[i].number_value(); }
2042  }
2043  }
2044  if(!parsed["mxmom"].is_null()) { mxmom = parsed["mxmom"].number_value(); }
2045  if(!parsed["tc"].is_null()) { tc = parsed["tc"].number_value(); }
2046  if(!parsed["rmom"].is_null()) { rmom = parsed["rmom"].number_value(); }
2047  if(!parsed["mom"].is_null()) { mom = parsed["mom"].number_value(); }
2048  } else {
2049  cerr<<"ERROR: <"<<error<<">"<<endl;
2050  }
2051  return;
2052  }
2053 };
2054 
2056 struct cpustruc
2057 {
2058  // cpu
2060  uint32_t uptime = 0;
2062  float load = 0.f;
2064  float maxload = 0.f;
2065 
2066  // memory
2068  float maxgib = 0.f;
2070  float gib = 0.f;
2071 
2073  uint32_t boot_count = 0;
2074 
2076 
2080  return json11::Json::object {
2081  { "uptime" , static_cast<int>(uptime) },
2082  { "load" , load },
2083  { "maxload", maxload },
2084  { "maxgib" , maxgib },
2085  { "gib" , gib },
2086  { "boot_count", static_cast<int>(boot_count) },
2087  };
2088  }
2089 
2091 
2096  void from_json(const string& s) {
2097  string error;
2098  json11::Json parsed = json11::Json::parse(s,error);
2099  if(error.empty()) {
2100  if(!parsed["uptime"].is_null()) { uptime = parsed["uptime"].int_value(); }
2101  if(!parsed["load"].is_null()) { load = parsed["load"].number_value(); }
2102  if(!parsed["maxload"].is_null()) { maxload = parsed["maxload"].number_value(); }
2103  if(!parsed["maxgib"].is_null()) { maxgib = parsed["maxgib"].number_value(); }
2104  if(!parsed["gib"].is_null()) { gib = parsed["gib"].number_value(); }
2105  if(!parsed["boot_count"].is_null()) { boot_count = parsed["boot_count"].int_value(); }
2106  } else {
2107  cerr<<"ERROR: <"<<error<<">"<<endl;
2108  }
2109  return;
2110  }
2111 };
2112 
2115 {
2116  // disk
2118  float maxgib = 0.f; // TODO: rename to diskSize, consider bytes?
2120  float gib = 0.f; // TODO: rename to diskUsed, consider bytes?
2122  char path[COSMOS_MAX_NAME] = "";
2123 
2125 
2129  return json11::Json::object {
2130  { "maxgib" , maxgib },
2131  { "gib" , gib },
2132  { "path" , path }
2133  };
2134  }
2135 
2137 
2142  void from_json(const string& s) {
2143  string error;
2144  json11::Json parsed = json11::Json::parse(s,error);
2145  if(error.empty()) {
2146  if(!parsed["maxgib"].is_null()) { maxgib = parsed["maxgib"].number_value(); }
2147  if(!parsed["gib"].is_null()) { gib = parsed["gib"].number_value(); }
2148  if(!parsed["path"].is_null()) { strcpy(path, parsed["gib"].string_value().c_str()); }
2149  } else {
2150  cerr<<"ERROR: <"<<error<<">"<<endl;
2151  }
2152  return;
2153  }
2154 };
2155 
2156 // TODO: rename to GpsData
2157 struct gpsstruc
2158 {
2160  double dutc = 0.;
2163  // TODO: rename variables to more meaningfull names like position, velocity
2180  float heading = 0.f;
2182  uint16_t sats_used = 0;
2184  uint16_t sats_visible = 0;
2186  uint16_t time_status = 0;
2188  uint16_t position_type = 0;
2190  uint16_t solution_status = 0;
2191 
2193 
2197  return json11::Json::object {
2198  { "dutc" , dutc },
2199  { "geocs" , geocs },
2200  { "geocv" , geocv },
2201  { "dgeocs" , dgeocs },
2202  { "dgeocv" , dgeocv },
2203  { "geods" , geods },
2204  { "geodv" , geodv },
2205  { "dgeods" , dgeods },
2206  { "dgeodv" , dgeodv },
2207  { "heading", heading },
2208  { "sats_used" , sats_used },
2209  { "sats_visible" , sats_visible },
2210  { "time_status" , time_status },
2211  { "position_type", position_type },
2212  { "solution_status", solution_status }
2213  };
2214  }
2215 
2217 
2222  void from_json(const string& s) {
2223  string error;
2224  json11::Json parsed = json11::Json::parse(s,error);
2225  if(error.empty()) {
2226  if(!parsed["dutc"].is_null()) { dutc = parsed["dutc"].number_value(); }
2227  if(!parsed["geocs"].is_null()) { geocs.from_json(parsed["geocs"].dump()); }
2228  if(!parsed["geocv"].is_null()) { geocv.from_json(parsed["geocv"].dump()); }
2229  if(!parsed["dgeocs"].is_null()) { dgeocs.from_json(parsed["dgeocs"].dump()); }
2230  if(!parsed["dgeocv"].is_null()) { dgeocv.from_json(parsed["dgeocv"].dump()); }
2231  if(!parsed["geods"].is_null()) { geods.from_json(parsed["geods"].dump()); }
2232  if(!parsed["geodv"].is_null()) { geodv.from_json(parsed["geodv"].dump()); }
2233  if(!parsed["dgeods"].is_null()) { dgeods.from_json(parsed["dgeods"].dump()); }
2234  if(!parsed["dgeodv"].is_null()) { dgeodv.from_json(parsed["dgeodv"].dump()); }
2235  if(!parsed["heading"].is_null()) { heading = parsed["heading"].number_value(); }
2236  if(!parsed["sats_used"].is_null()) { sats_used = parsed["sats_used"].int_value(); }
2237  if(!parsed["sats_visible"].is_null()) { sats_visible = parsed["sats_visible"].int_value(); }
2238  if(!parsed["time_status"].is_null()) { time_status = parsed["time_status"].int_value(); }
2239  if(!parsed["position_type"].is_null()) { position_type = parsed["position_type"].int_value(); }
2240  if(!parsed["solution_status"].is_null()) { solution_status = parsed["solution_status"].int_value(); }
2241  } else {
2242  cerr<<"ERROR: <"<<error<<">"<<endl;
2243  }
2244  return;
2245  }
2246 };
2247 
2249 
2251 struct antstruc
2252 {
2256  float azim = 0.f;
2258  float elev = 0.f;
2260  float minelev = 0.f;
2262  float maxelev = 0.f;
2264  float minazim = 0.f;
2266  float maxazim = 0.f;
2268  float threshelev = 0.f;
2269 
2271 
2275  return json11::Json::object {
2276  { "align" , align },
2277  { "azim" , azim },
2278  { "elev" , elev },
2279  { "minelev" , minelev },
2280  { "maxelev" , maxelev },
2281  { "minazim" , minazim },
2282  { "maxazim" , maxazim },
2283  { "threshelev" , threshelev }
2284  };
2285  }
2286 
2288 
2293  void from_json(const string& s) {
2294  string error;
2295  json11::Json parsed = json11::Json::parse(s,error);
2296  if(error.empty()) {
2297  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
2298  if(!parsed["azim"].is_null()) { azim = parsed["azim"].number_value(); }
2299  if(!parsed["elev"].is_null()) { elev = parsed["elev"].number_value(); }
2300  if(!parsed["minelev"].is_null()) { minelev = parsed["minelev"].number_value(); }
2301  if(!parsed["maxelev"].is_null()) { maxelev = parsed["maxelev"].number_value(); }
2302  if(!parsed["minazim"].is_null()) { minazim = parsed["minazim"].number_value(); }
2303  if(!parsed["maxazim"].is_null()) { maxazim = parsed["maxazim"].number_value(); }
2304  if(!parsed["threshelev"].is_null()) { threshelev = parsed["threshelev"].number_value(); }
2305  } else {
2306  cerr<<"ERROR: <"<<error<<">"<<endl;
2307  }
2308  return;
2309  }
2310 };
2311 
2313 
2315 struct rxrstruc
2316 {
2318  uint16_t opmode = 0;
2320  uint16_t modulation = 0;
2322  uint16_t rssi = 0;
2324  uint16_t pktsize = 0;
2326  double freq = 0.;
2328  double maxfreq = 0.;
2330  double minfreq = 0.;
2332  float powerin = 0.f;
2334  float powerout = 0.f;
2336  float maxpower = 0.f;
2338  float band = 0.f;
2340  float squelch_tone = 0.f;
2342  double goodratio = 0.;
2344  double rxutc = 0.;
2346  double uptime = 0.;
2347 
2349 
2353  return json11::Json::object {
2354  { "opmode" , opmode },
2355  { "modulation" , modulation },
2356  { "rssi" , rssi },
2357  { "pktsize", pktsize },
2358  { "freq" , freq },
2359  { "maxfreq", maxfreq },
2360  { "minfreq", minfreq },
2361  { "powerin", powerin },
2362  { "powerout" , powerout },
2363  { "maxpower" , maxpower },
2364  { "band" , band },
2365  { "squelch_tone", squelch_tone },
2366  { "goodratio", goodratio },
2367  { "rxutc" , rxutc },
2368  { "uptime" , uptime }
2369  };
2370  }
2371 
2373 
2378  void from_json(const string& s) {
2379  string error;
2380  json11::Json parsed = json11::Json::parse(s,error);
2381  if(error.empty()) {
2382  if(!parsed["opmode"].is_null()) { opmode = parsed["opmode"].int_value(); }
2383  if(!parsed["modulation"].is_null()) { modulation = parsed["modulation"].int_value(); }
2384  if(!parsed["rssi"].is_null()) { rssi = parsed["rssi"].int_value(); }
2385  if(!parsed["pktsize"].is_null()) { pktsize = parsed["pktsize"].int_value(); }
2386  if(!parsed["freq"].is_null()) { freq = parsed["freq"].number_value(); }
2387  if(!parsed["maxfreq"].is_null()) { maxfreq = parsed["maxfreq"].number_value(); }
2388  if(!parsed["minfreq"].is_null()) { minfreq = parsed["minfreq"].number_value(); }
2389  if(!parsed["powerin"].is_null()) { powerin = parsed["powerin"].number_value(); }
2390  if(!parsed["powerout"].is_null()) { powerout = parsed["powerout"].number_value(); }
2391  if(!parsed["maxpower"].is_null()) { maxpower = parsed["maxpower"].number_value(); }
2392  if(!parsed["band"].is_null()) { band = parsed["band"].number_value(); }
2393  if(!parsed["squelch_tone"].is_null()) { squelch_tone = parsed["squelch_tone"].number_value(); }
2394  if(!parsed["goodratio"].is_null()) { goodratio = parsed["goodratio"].number_value(); }
2395  if(!parsed["rxutc"].is_null()) { rxutc = parsed["rxutc"].number_value(); }
2396  if(!parsed["uptime"].is_null()) { uptime = parsed["uptime"].number_value(); }
2397  } else {
2398  cerr<<"ERROR: <"<<error<<">"<<endl;
2399  }
2400  return;
2401  }
2402 };
2403 
2405 
2407 struct txrstruc
2408 {
2410  uint16_t opmode = 0;
2412  uint16_t modulation = 0;
2414  uint16_t rssi = 0;
2416  uint16_t pktsize = 0;
2418  double freq = 0.;
2420  double maxfreq = 0.;
2422  double minfreq = 0.;
2424  float powerin = 0.f;
2426  float powerout = 0.f;
2428  float maxpower = 0.f;
2430  float band = 0.f;
2432  float squelch_tone = 0.f;
2434  double goodratio = 0.;
2436  double txutc = 0.;
2438  double uptime = 10.;
2439 
2441 
2445  return json11::Json::object {
2446  { "opmode" , opmode },
2447  { "modulation" , modulation },
2448  { "rssi" , rssi },
2449  { "pktsize", pktsize },
2450  { "freq" , freq },
2451  { "maxfreq", maxfreq },
2452  { "minfreq", minfreq },
2453  { "powerin", powerin },
2454  { "powerout" , powerout },
2455  { "maxpower" , maxpower },
2456  { "band" , band },
2457  { "squelch_tone", squelch_tone },
2458  { "goodratio", goodratio },
2459  { "txutc" , txutc },
2460  { "uptime" , uptime }
2461  };
2462  }
2463 
2465 
2470  void from_json(const string& s) {
2471  string error;
2472  json11::Json parsed = json11::Json::parse(s,error);
2473  if(error.empty()) {
2474  if(!parsed["opmode"].is_null()) { opmode = parsed["opmode"].int_value(); }
2475  if(!parsed["modulation"].is_null()) { modulation = parsed["modulation"].int_value(); }
2476  if(!parsed["rssi"].is_null()) { rssi = parsed["rssi"].int_value(); }
2477  if(!parsed["pktsize"].is_null()) { pktsize = parsed["pktsize"].int_value(); }
2478  if(!parsed["freq"].is_null()) { freq = parsed["freq"].number_value(); }
2479  if(!parsed["maxfreq"].is_null()) { maxfreq = parsed["maxfreq"].number_value(); }
2480  if(!parsed["minfreq"].is_null()) { minfreq = parsed["minfreq"].number_value(); }
2481  if(!parsed["powerin"].is_null()) { powerin = parsed["powerin"].number_value(); }
2482  if(!parsed["powerout"].is_null()) { powerout = parsed["powerout"].number_value(); }
2483  if(!parsed["maxpower"].is_null()) { maxpower = parsed["maxpower"].number_value(); }
2484  if(!parsed["band"].is_null()) { band = parsed["band"].number_value(); }
2485  if(!parsed["squelch_tone"].is_null()) { squelch_tone = parsed["squelch_tone"].number_value(); }
2486  if(!parsed["goodratio"].is_null()) { goodratio = parsed["goodratio"].number_value(); }
2487  if(!parsed["txutc"].is_null()) { txutc = parsed["txutc"].number_value(); }
2488  if(!parsed["uptime"].is_null()) { uptime = parsed["uptime"].number_value(); }
2489  } else {
2490  cerr<<"ERROR: <"<<error<<">"<<endl;
2491  }
2492  return;
2493  }
2494 };
2495 
2497 
2499 struct tcvstruc
2500 {
2502  uint16_t opmode = 0;
2504  uint16_t modulation = 0;
2506  uint16_t rssi = 0;
2508  uint16_t pktsize = 0;
2510  double freq = 0.;
2512  double maxfreq = 0.;
2514  double minfreq = 0.;
2516  float powerin = 0.f;
2518  float powerout = 0.f;
2520  float maxpower = 0.f;
2522  float band = 0.f;
2524  float squelch_tone = 0.f;
2526  double goodratio = 0.;
2528  double txutc = 0.;
2530  double rxutc = 0.;
2532  double uptime = 0.;
2533 
2535 
2539  return json11::Json::object {
2540  { "opmode" , opmode },
2541  { "modulation" , modulation },
2542  { "rssi" , rssi },
2543  { "pktsize", pktsize },
2544  { "freq" , freq },
2545  { "maxfreq", maxfreq },
2546  { "minfreq", minfreq },
2547  { "powerin", powerin },
2548  { "powerout" , powerout },
2549  { "maxpower" , maxpower },
2550  { "band" , band },
2551  { "squelch_tone", squelch_tone },
2552  { "goodratio", goodratio },
2553  { "txutc" , txutc },
2554  { "rxutc" , rxutc },
2555  { "uptime" , uptime }
2556  };
2557  }
2558 
2560 
2565  void from_json(const string& s) {
2566  string error;
2567  json11::Json parsed = json11::Json::parse(s,error);
2568  if(error.empty()) {
2569  if(!parsed["opmode"].is_null()) { opmode = parsed["opmode"].int_value(); }
2570  if(!parsed["modulation"].is_null()) { modulation = parsed["modulation"].int_value(); }
2571  if(!parsed["rssi"].is_null()) { rssi = parsed["rssi"].int_value(); }
2572  if(!parsed["pktsize"].is_null()) { pktsize = parsed["pktsize"].int_value(); }
2573  if(!parsed["freq"].is_null()) { freq = parsed["freq"].number_value(); }
2574  if(!parsed["maxfreq"].is_null()) { maxfreq = parsed["maxfreq"].number_value(); }
2575  if(!parsed["minfreq"].is_null()) { minfreq = parsed["minfreq"].number_value(); }
2576  if(!parsed["powerin"].is_null()) { powerin = parsed["powerin"].number_value(); }
2577  if(!parsed["powerout"].is_null()) { powerout = parsed["powerout"].number_value(); }
2578  if(!parsed["maxpower"].is_null()) { maxpower = parsed["maxpower"].number_value(); }
2579  if(!parsed["band"].is_null()) { band = parsed["band"].number_value(); }
2580  if(!parsed["squelch_tone"].is_null()) { squelch_tone = parsed["squelch_tone"].number_value(); }
2581  if(!parsed["goodratio"].is_null()) { goodratio = parsed["goodratio"].number_value(); }
2582  if(!parsed["txutc"].is_null()) { txutc = parsed["txutc"].number_value(); }
2583  if(!parsed["rxutc"].is_null()) { rxutc = parsed["rxutc"].number_value(); }
2584  if(!parsed["uptime"].is_null()) { uptime = parsed["uptime"].number_value(); }
2585  } else {
2586  cerr<<"ERROR: <"<<error<<">"<<endl;
2587  }
2588  return;
2589  }
2590 };
2591 
2593 
2596 {
2598  uint16_t bcidx = 0;
2600  float effbase = 0.f;
2602  float effslope = 0.f;
2604  float maxpower = 0.f;
2606  float power = 0.f;
2607 
2609 
2613  return json11::Json::object {
2614  { "bcidx" , bcidx },
2615  { "effbase", effbase },
2616  { "effslope", effslope },
2617  { "maxpower", maxpower },
2618  { "power" , power}
2619  };
2620  }
2621 
2623 
2628  void from_json(const string& s) {
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  }
2642 };
2643 
2646 {
2648  float capacity = 0.f;
2650  float efficiency = 0.f;
2652  float charge = 0.f;
2654  float r_in = 0.f;
2656  float r_out = 0.f;
2658  float percentage = 0.f;
2660  float time_remaining = 0.f;
2661 
2663 
2667  return json11::Json::object {
2668  { "capacity" , capacity },
2669  { "efficiency", efficiency },
2670  { "charge" , charge },
2671  { "r_in" , r_in },
2672  { "r_out" , r_out },
2673  { "percentage", percentage },
2674  { "time_remaining" , time_remaining }
2675  };
2676  }
2677 
2679 
2684  void from_json(const string& s) {
2685  string error;
2686  json11::Json parsed = json11::Json::parse(s,error);
2687  if(error.empty()) {
2688  if(!parsed["capacity"].is_null()) { capacity = parsed["capacity"].number_value(); }
2689  if(!parsed["efficiency"].is_null()) { efficiency = parsed["efficiency"].number_value(); }
2690  if(!parsed["charge"].is_null()) { charge = parsed["charge"].number_value(); }
2691  if(!parsed["r_in"].is_null()) { r_in = parsed["r_in"].number_value(); }
2692  if(!parsed["r_out"].is_null()) { r_out = parsed["r_out"].number_value(); }
2693  if(!parsed["percentage"].is_null()) { percentage = parsed["percentage"].number_value(); }
2694  if(!parsed["time_remaining"].is_null()) { time_remaining = parsed["time_remaining"].number_value(); }
2695  } else {
2696  cerr<<"ERROR: <"<<error<<">"<<endl;
2697  }
2698  return;
2699  }
2700 };
2701 
2703 
2705 struct htrstruc
2706 {
2707  bool state = true;
2709  float setvertex = 0.f;
2710 
2712 
2716  return json11::Json::object {
2717  { "state" , state },
2718  { "setvertex" , setvertex }
2719  };
2720  }
2721 
2723 
2728  void from_json(const string& s) {
2729  string error;
2730  json11::Json parsed = json11::Json::parse(s,error);
2731  if(error.empty()) {
2732  if(!parsed["state"].is_null()) { state = parsed["state"].bool_value(); }
2733  if(!parsed["setvertex"].is_null()) { setvertex = parsed["setvertex"].number_value(); }
2734  } else {
2735  cerr<<"ERROR: <"<<error<<">"<<endl;
2736  }
2737  return;
2738  }
2739 };
2740 
2742 {
2744  float max = 0.f;
2746  float rat = 0.f;
2747  float spd = 0.f;
2748 
2750 
2754  return json11::Json::object {
2755  { "max" , max },
2756  { "rat" , rat },
2757  { "spd" , spd }
2758  };
2759  }
2760 
2762 
2767  void from_json(const string& s) {
2768  string error;
2769  json11::Json parsed = json11::Json::parse(s,error);
2770  if(error.empty()) {
2771  if(!parsed["max"].is_null()) { max = parsed["max"].number_value(); }
2772  if(!parsed["rat"].is_null()) { rat = parsed["rat"].number_value(); }
2773  if(!parsed["spd"].is_null()) { spd = parsed["spd"].number_value(); }
2774  } else {
2775  cerr<<"ERROR: <"<<error<<">"<<endl;
2776  }
2777  return;
2778  }
2779 };
2780 
2781 struct tsenstruc {
2783 
2787 
2789 
2794  void from_json(const string& s) {};
2795 };
2796 
2799 {
2803  float flw = 0.f;
2805  float isp = 0.f;
2806 
2808 
2812  return json11::Json::object {
2813  { "align" , align },
2814  { "flw" , flw },
2815  { "isp" , isp }
2816  };
2817  }
2818 
2820 
2825  void from_json(const string& s) {
2826  string error;
2827  json11::Json parsed = json11::Json::parse(s,error);
2828  if(error.empty()) {
2829  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
2830  if(!parsed["flw"].is_null()) { flw = parsed["flw"].number_value(); }
2831  if(!parsed["isp"].is_null()) { isp = parsed["isp"].number_value(); }
2832  } else {
2833  cerr<<"ERROR: <"<<error<<">"<<endl;
2834  }
2835  return;
2836  }
2837 };
2838 
2841 {
2843  float cap = 0.f;
2845  float lev = 0.f;
2846 
2848 
2852  return json11::Json::object {
2853  { "cap" , cap },
2854  { "lev" , lev }
2855  };
2856  }
2857 
2859 
2864  void from_json(const string& s) {
2865  string error;
2866  json11::Json parsed = json11::Json::parse(s,error);
2867  if(error.empty()) {
2868  if(!parsed["cap"].is_null()) { cap = parsed["cap"].number_value(); }
2869  if(!parsed["lev"].is_null()) { lev = parsed["lev"].number_value(); }
2870  } else {
2871  cerr<<"ERROR: <"<<error<<">"<<endl;
2872  }
2873  return;
2874  }
2875 };
2876 
2878 
2880 struct swchstruc {
2882 
2886 
2888 
2893  void from_json(const string& s) {};
2894 };
2895 
2897 
2899 struct rotstruc
2900 {
2902  float angle = 0.f;
2903 
2905 
2909  return json11::Json::object {
2910  { "angle" , angle }
2911  };
2912  }
2913 
2915 
2920  void from_json(const string& s) {
2921  string error;
2922  json11::Json parsed = json11::Json::parse(s,error);
2923  if(error.empty()) {
2924  if(!parsed["angle"].is_null()) { angle = parsed["angle"].number_value(); }
2925  } else {
2926  cerr<<"ERROR: <"<<error<<">"<<endl;
2927  }
2928  return;
2929  }
2930 };
2931 
2933 // TODO: rename to ST
2934 struct sttstruc
2935 {
2939  quaternion att; // TODO: rename to q
2943  uint16_t retcode = 0;
2944  uint32_t status = 0;
2945 
2947 
2951  return json11::Json::object {
2952  { "align" , align },
2953  { "att" , att },
2954  { "omega" , omega },
2955  { "alpha" , alpha },
2956  { "retcode", retcode },
2957  { "status" , static_cast<int>(status) }
2958  };
2959  }
2960 
2962 
2967  void from_json(const string& s) {
2968  string error;
2969  json11::Json parsed = json11::Json::parse(s,error);
2970  if(error.empty()) {
2971  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
2972  if(!parsed["att"].is_null()) { att.from_json(parsed["att"].dump()); }
2973  if(!parsed["omega"].is_null()) { omega.from_json(parsed["omega"].dump()); }
2974  if(!parsed["alpha"].is_null()) { alpha.from_json(parsed["alpha"].dump()); }
2975  if(!parsed["retcode"].is_null()) { retcode = parsed["retcode"].int_value(); }
2976  if(!parsed["status"].is_null()) { status = parsed["status"].int_value(); }
2977  } else {
2978  cerr<<"ERROR: <"<<error<<">"<<endl;
2979  }
2980  return;
2981  }
2982 };
2983 
2985 struct mccstruc
2986 {
2993 
2995 
2999  return json11::Json::object {
3000  { "align" , align },
3001  { "q" , q },
3002  { "o" , o },
3003  { "a" , a }
3004  };
3005  }
3006 
3008 
3013  void from_json(const string& s) {
3014  string error;
3015  json11::Json parsed = json11::Json::parse(s,error);
3016  if(error.empty()) {
3017  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
3018  if(!parsed["q"].is_null()) { q.from_json(parsed["q"].dump()); }
3019  if(!parsed["o"].is_null()) { o.from_json(parsed["o"].dump()); }
3020  if(!parsed["a"].is_null()) { a.from_json(parsed["a"].dump()); }
3021  } else {
3022  cerr<<"ERROR: <"<<error<<">"<<endl;
3023  }
3024  return;
3025  }
3026 };
3027 
3029 struct tcustruc
3030 {
3032  uint16_t mcnt = 0;
3034  uint16_t mcidx[3] = {0};
3035 
3037 
3041  vector<uint16_t> v_mcidx = vector<uint16_t>(mcidx, mcidx+sizeof(mcidx)/sizeof(mcidx[0]));
3042  return json11::Json::object {
3043  { "mcnt" , mcnt },
3044  { "mcidx", v_mcidx }
3045  };
3046  }
3047 
3049 
3054  void from_json(const string& s) {
3055  string error;
3056  json11::Json parsed = json11::Json::parse(s,error);
3057  if(error.empty()) {
3058  if(!parsed["mcnt"].is_null()) { mcnt = parsed["mcnt"].int_value(); }
3059  if(!parsed["mcidx"].is_null()) {
3060  auto p_mcidx = parsed["mcidx"].array_items();
3061  for(size_t i = 0; i != p_mcidx.size(); ++i) {
3062  if(!p_mcidx[i].is_null()) { mcidx[i] = p_mcidx[i].int_value(); }
3063  }
3064  }
3065  } else {
3066  cerr<<"ERROR: <"<<error<<">"<<endl;
3067  }
3068  return;
3069  }
3070 };
3071 
3072 struct busstruc
3073 {
3075  float wdt = 0.f;
3076 
3078 
3082  return json11::Json::object {
3083  { "wdt" , wdt }
3084  };
3085  }
3086 
3088 
3093  void from_json(const string& s) {
3094  string error;
3095  json11::Json parsed = json11::Json::parse(s,error);
3096  if(error.empty()) {
3097  if(!parsed["wdt"].is_null()) { wdt = parsed["wdt"].number_value();}
3098  } else {
3099  cerr<<"ERROR: <"<<error<<">"<<endl;
3100  }
3101  return;
3102  }
3103 };
3104 
3106 {
3108  float press = 0.f;
3109 
3111 
3115  return json11::Json::object {
3116  { "press" , press }
3117  };
3118  }
3119 
3121 
3126  void from_json(const string& s) {
3127  string error;
3128  json11::Json parsed = json11::Json::parse(s,error);
3129  if(error.empty()) {
3130  if(!parsed["press"].is_null()) { press = parsed["press"].number_value(); }
3131  } else {
3132  cerr<<"ERROR: <"<<error<<">"<<endl;
3133  }
3134  return;
3135  }
3136 };
3137 
3140 {
3144  float press = 0.f;
3146  float temps[8] = {0.f};
3147 
3149 
3153  vector<float> v_temps = vector<float>(temps, temps+sizeof(temps)/sizeof(temps[0]));
3154  return json11::Json::object {
3155  { "align" , align },
3156  { "press" , press },
3157  { "temps" , v_temps }
3158  };
3159  }
3160 
3162 
3167  void from_json(const string& s) {
3168  string error;
3169  json11::Json parsed = json11::Json::parse(s,error);
3170  if(error.empty()) {
3171  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
3172  if(!parsed["press"].is_null()) { press = parsed["press"].number_value(); }
3173  if(!parsed["temps"].is_null()) {
3174  if(!parsed["press"].is_null()) { press = parsed["press"].number_value(); }
3175  auto p_temps = parsed["temps"].array_items();
3176  for(size_t i = 0; i != p_temps.size(); ++i) {
3177  if(!p_temps[i].is_null()) { temps[i] = p_temps[i].number_value(); }
3178  }
3179  }
3180  } else {
3181  cerr<<"ERROR: <"<<error<<">"<<endl;
3182  }
3183  return;
3184  }
3185 };
3186 
3187 struct camstruc
3188 {
3189  uint16_t pwidth = 0;
3190  uint16_t pheight = 0;
3191  float width = 0.f;
3192  float height = 0.f;
3193  float flength = 0.f;
3194 
3196 
3200  return json11::Json::object {
3201  { "pwidth" , pwidth },
3202  { "pheight", pheight },
3203  { "width" , width },
3204  { "height" , height },
3205  { "flength", flength }
3206  };
3207  }
3208 
3210 
3215  void from_json(const string& s) {
3216  string error;
3217  json11::Json parsed = json11::Json::parse(s,error);
3218  if(error.empty()) {
3219  if(!parsed["pwidth"].is_null()) { pwidth = parsed["pwidth"].int_value(); }
3220  if(!parsed["pheight"].is_null()) { pheight = parsed["pheight"].int_value(); }
3221  if(!parsed["width"].is_null()) { width = parsed["width"].number_value(); }
3222  if(!parsed["height"].is_null()) { height = parsed["height"].number_value(); }
3223  if(!parsed["flength"].is_null()) { flength = parsed["flength"].number_value(); }
3224  } else {
3225  cerr<<"ERROR: <"<<error<<">"<<endl;
3226  }
3227  return;
3228  }
3229 };
3230 
3232 
3234 struct tncstruc {
3236 
3240 
3242 
3247  void from_json(const string& s) {};
3248 };
3249 
3251 
3253 struct bcregstruc {
3255 
3260 
3262 
3267  void from_json(const string& s) {};
3268 };
3269 
3270 // End of Device Specific structures
3271 
3276 {
3278  uint8_t external = 1;
3288  uint16_t pidx = 0;
3289  uint16_t tidx[3] = {0};
3291  float heat = 0.f;
3293  float hcap = 900.f;
3295  float emi = .88f;
3297  float abs = .18f;
3299  float iemi = .88f;
3301  float iabs = .88f;
3303  float mass = 1.f;
3305  float temp = 0.f;
3307  float area = 0.f;
3309  float depth = 0.f;
3311  float perimeter = 0.f;
3313  float irradiation = 0.f;
3315  float pcell = 0.f;
3317  float ecellbase = .25f;
3319  float ecellslope = 0.f;
3321  float vcell = 10.;
3323  float power = 0.f;
3325  float volt = 0.f;
3327  float amp = 0.f;
3328  vector<vector<uint16_t>> triangleindex;
3329 
3331 
3335  vector<uint16_t> v_tidx = vector<uint16_t>(tidx, tidx+sizeof(tidx)/sizeof(tidx[0]));
3336  return json11::Json::object {
3337  { "external" , external },
3338  { "com" , com },
3339  { "normal" , normal },
3340  { "shove" , shove },
3341  { "twist" , twist },
3342  { "pidx" , pidx },
3343  { "tidx" , v_tidx },
3344  { "heat" , heat },
3345  { "hcap" , hcap },
3346  { "emi" , emi },
3347  { "abs" , abs },
3348  { "iemi" , iemi },
3349  { "iabs" , iabs },
3350  { "mass" , mass },
3351  { "temp" , temp },
3352  { "area" , area },
3353  { "depth" , depth },
3354  { "perimeter" , perimeter },
3355  { "irradiation" , irradiation },
3356  { "pcell" , pcell },
3357  { "ecellbase" , ecellbase },
3358  { "ecellslope" , ecellslope },
3359  { "triangleindex" , triangleindex }
3360  };
3361  }
3362 
3364 
3369  void from_json(const string& s) {
3370  string error;
3371  json11::Json parsed = json11::Json::parse(s,error);
3372  if(error.empty()) {
3373  if(!parsed["external"].is_null()) { external = parsed["external"].int_value(); }
3374  if(!parsed["com"].is_null()) { com.from_json(parsed["com"].dump()); }
3375  if(!parsed["normal"].is_null()) { normal.from_json(parsed["normal"].dump()); }
3376  if(!parsed["shove"].is_null()) { shove.from_json(parsed["shove"].dump()); }
3377  if(!parsed["twist"].is_null()) { twist.from_json(parsed["twist"].dump()); }
3378  if(!parsed["pidx"].is_null()) { pidx = parsed["pidx"].int_value(); }
3379 
3380  // Array
3381  if(!parsed["heat"].is_null()) { heat = parsed["heat"].number_value(); }
3382  if(!parsed["hcap"].is_null()) { hcap = parsed["hcap"].number_value(); }
3383  if(!parsed["emi"].is_null()) { emi = parsed["emi"].number_value(); }
3384  if(!parsed["abs"].is_null()) { abs = parsed["abs"].number_value(); }
3385  if(!parsed["iemi"].is_null()) { emi = parsed["iemi"].number_value(); }
3386  if(!parsed["iabs"].is_null()) { abs = parsed["iabs"].number_value(); }
3387  if(!parsed["mass"].is_null()) { mass = parsed["mass"].number_value(); }
3388  if(!parsed["temp"].is_null()) { temp = parsed["temp"].number_value(); }
3389  if(!parsed["area"].is_null()) { area = parsed["area"].number_value(); }
3390  if(!parsed["perimeter"].is_null()) { perimeter = parsed["perimeter"].number_value(); }
3391  if(!parsed["irradiation"].is_null()) { irradiation = parsed["irradiation"].number_value(); }
3392  if(!parsed["pcell"].is_null()) { pcell = parsed["pcell"].number_value(); }
3393  if(!parsed["ecellbase"].is_null()) { ecellbase = parsed["ecellbase"].number_value(); }
3394  if(!parsed["ecellslope"].is_null()) { ecellslope = parsed["ecellslope"].number_value(); }
3395  for(size_t i = 0; i < triangleindex.size(); ++i) {
3396  for(size_t j = 0; j < triangleindex[i].size(); ++j) {
3397  if(!parsed["triangleindex"][i][j].is_null()) { triangleindex[i][j] = parsed["triangleindex"][i][j].number_value(); }
3398  }
3399  }
3400  } else {
3401  cerr<<"ERROR: <"<<error<<">"<<endl;
3402  }
3403  return;
3404  }
3405 };
3406 
3408 
3412 {
3414  double dt = 0.;
3416  double dtj = 0.;
3418  double utc = 0.;
3420  double mjdaccel = 0.;
3422  double mjddiff = 0.;
3423 
3424  float hcap = 900.f;
3425  float mass = 1.f;
3426  float temp = 300.f;
3427  float heat = 300. * 900. * 1.;
3428  float radiation;
3429  float area = .001f;
3430  float battcap = 36000.f;
3431  float battlev = 0.f;
3432  float powgen = 0.f;
3433  float powuse = 0.f;
3434 
3436  int32_t mode = 0;
3448  Vector moi = Vector(1.,1.,1.);
3450 
3451  vector <Vector> vertices;
3452  vector <trianglestruc> triangles;
3453 
3455 
3459  return json11::Json::object {
3460  { "dt" , dt },
3461  { "dtj" , dtj },
3462  { "utc" , utc },
3463  { "mjdaccel" , mjdaccel },
3464  { "mjddiff" , mjddiff },
3465  { "hcap" , hcap },
3466  { "mass" , mass },
3467  { "temp" , temp },
3468  { "heat" , heat },
3469  { "area" , area },
3470  { "radiation" , radiation },
3471  { "battcap" , battcap },
3472  { "battlev" , battlev },
3473  { "powgen" , powgen },
3474  { "powuse" , powuse },
3475  { "mode" , mode },
3476 
3477  { "ftorque" , ftorque },
3478  { "atorque" , atorque },
3479  { "rtorque" , rtorque },
3480  { "gtorque" , gtorque },
3481  { "htorque" , htorque },
3482  { "hmomentum" , hmomentum },
3483  { "ctorque" , ctorque },
3484  { "fdrag" , fdrag },
3485  { "adrag" , adrag },
3486  { "rdrag" , rdrag },
3487  { "thrust" , thrust },
3488  { "moi" , moi },
3489  { "com" , com },
3490  { "vertices" , vertices },
3491  { "triangles" , triangles }
3492  };
3493  }
3494 
3496 
3501  void from_json(const string& js) {
3502  string error;
3503  json11::Json parsed = json11::Json::parse(js,error);
3504  if(error.empty()) {
3505  if(!parsed["dt"].is_null()) { dt = parsed["dt"].number_value(); }
3506  if(!parsed["dtj"].is_null()) { dtj = parsed["dtj"].number_value(); }
3507  if(!parsed["utc"].is_null()) { utc = parsed["utc"].number_value(); }
3508  if(!parsed["mjdaccel"].is_null()) { mjdaccel = parsed["mjdaccel"].number_value(); }
3509  if(!parsed["mjddiff"].is_null()) { mjddiff = parsed["mjddiff"].number_value(); }
3510  if(!parsed["hcap"].is_null()) { hcap = parsed["hcap"].number_value(); }
3511  if(!parsed["mass"].is_null()) { mass = parsed["mass"].number_value(); }
3512  if(!parsed["temp"].is_null()) { temp = parsed["temp"].number_value(); }
3513  if(!parsed["heat"].is_null()) { heat = parsed["heat"].number_value(); }
3514  if(!parsed["radiation"].is_null()) { radiation = parsed["radiation"].number_value(); }
3515  if(!parsed["area"].is_null()) { area = parsed["area"].number_value(); }
3516  if(!parsed["battcap"].is_null()) { battcap = parsed["battcap"].number_value(); }
3517  if(!parsed["battlev"].is_null()) { battlev = parsed["battlev"].number_value(); }
3518  if(!parsed["powgen"].is_null()) { powgen = parsed["powgen"].number_value(); }
3519  if(!parsed["powuse"].is_null()) { powuse = parsed["powuse"].number_value(); }
3520  if(!parsed["mode"].is_null()) { mode = parsed["mode"].int_value(); }
3521 
3522  if(!parsed["ftorque"].is_null()) { ftorque.from_json(parsed["ftorque"].dump()); }
3523  if(!parsed["atorque"].is_null()) { atorque.from_json(parsed["atorque"].dump()); }
3524  if(!parsed["rtorque"].is_null()) { rtorque.from_json(parsed["rtorque"].dump()); }
3525  if(!parsed["gtorque"].is_null()) { gtorque.from_json(parsed["gtorque"].dump()); }
3526  if(!parsed["htorque"].is_null()) { htorque.from_json(parsed["htorque"].dump()); }
3527  if(!parsed["hmomentum"].is_null()) { hmomentum.from_json(parsed["hmomentum"].dump()); }
3528  if(!parsed["ctorque"].is_null()) { ctorque.from_json(parsed["ctorque"].dump()); }
3529  if(!parsed["fdrag"].is_null()) { fdrag.from_json(parsed["fdrag"].dump()); }
3530  if(!parsed["adrag"].is_null()) { adrag.from_json(parsed["adrag"].dump()); }
3531  if(!parsed["rdrag"].is_null()) { rdrag.from_json(parsed["rdrag"].dump()); }
3532  if(!parsed["thrust"].is_null()) { thrust.from_json(parsed["thrust"].dump()); }
3533  if(!parsed["moi"].is_null()) { moi.from_json(parsed["moi"].dump()); }
3534  if(!parsed["com"].is_null()) { com.from_json(parsed["com"].dump()); }
3535  for(size_t i = 0; i < vertices.size(); ++i) {
3536  if(!parsed["vertices"][i].is_null()) { vertices[i].from_json(parsed["vertices"][i].dump()); }
3537  }
3538  for(size_t i = 0; i < triangles.size(); ++i) {
3539  if(!parsed["triangles"][i].is_null()) { triangles[i].from_json(parsed["triangles"][i].dump()); }
3540  }
3541  } else {
3542  cerr<<"ERROR = "<<error<<endl;
3543  }
3544  return;
3545  }
3546 
3547 
3548 };
3549 
3554 {
3556  char name[COSMOS_MAX_NAME+1] = "";
3558  char lastevent[COSMOS_MAX_NAME+1] = "";
3560  double lasteventutc = 0.;
3562  uint16_t type = 0;
3564  uint16_t state = 0;
3565 
3566  // actually these are cosmosstruc counts...
3567  uint16_t vertex_cnt = 0;
3568  uint16_t normal_cnt = 0;
3569  uint16_t face_cnt = 0;
3570  uint16_t piece_cnt = 0;
3571  uint16_t device_cnt = 0;
3572  uint16_t port_cnt = 0;
3573  uint16_t agent_cnt = 0;
3574  uint16_t event_cnt = 0;
3575  uint16_t target_cnt = 0;
3576  uint16_t user_cnt = 0;
3577  uint16_t tle_cnt = 0;
3578 
3579  uint16_t flags = 0;
3580  int16_t powmode = 0;
3582  uint32_t downtime = 0;
3584  float azfrom = 0.f;
3585  float elfrom = 0.f;
3586  float azto = 0.f;
3587  float elto = 0.f;
3588  float range = 0.f;
3590  double utcoffset = 0.;
3592  double utc = 0.;
3594  double utcstart = 0.;
3598 
3600 
3604  return json11::Json::object {
3605  { "name" , name },
3606  { "lastevent" , lastevent },
3607  { "lasteventutc" , lasteventutc },
3608  { "type" , type },
3609  { "state" , state },
3610 
3611  { "vertex_cnt" , vertex_cnt },
3612  { "normal_cnt" , normal_cnt },
3613  { "face_cnt" , face_cnt },
3614  { "piece_cnt" , piece_cnt },
3615  { "device_cnt" , device_cnt },
3616  { "port_cnt" , port_cnt },
3617  { "agent_cnt" , agent_cnt },
3618  { "event_cnt" , event_cnt },
3619  { "target_cnt" , target_cnt },
3620  { "user_cnt" , user_cnt },
3621  { "tle_cnt" , tle_cnt },
3622 
3623  { "flags" , flags },
3624  { "powmode" , powmode },
3625  { "downtime" , static_cast<int>(downtime) },
3626  { "azfrom" , azfrom },
3627  { "elfrom" , elfrom },
3628  { "azto" , azto },
3629  { "elto" , elto },
3630  { "range" , range },
3631  { "utcoffset" , utcoffset },
3632  { "utc" , utc },
3633  { "utcstart" , utcstart },
3634  { "loc" , loc },
3635  { "phys" , phys }
3636  };
3637  }
3638 
3640 
3645  void from_json(const string& js) {
3646  string error;
3647  json11::Json parsed = json11::Json::parse(js,error);
3648  if(error.empty()) {
3649  if(!parsed["name"].is_null()) { strcpy(name, parsed["name"].string_value().c_str()); }
3650  if(!parsed["lastevent"].is_null()) { strcpy(lastevent, parsed["lastevent"].string_value().c_str()); }
3651  if(!parsed["lasteventutc"].is_null()) { lasteventutc = parsed["lasteventutc"].number_value(); }
3652  if(!parsed["type"].is_null()) { type = parsed["type"].int_value(); }
3653  if(!parsed["state"].is_null()) { state = parsed["state"].int_value(); }
3654 
3655  if(!parsed["vertex_cnt"].is_null()) { vertex_cnt = parsed["vertex_cnt"].int_value(); }
3656  if(!parsed["normal_cnt"].is_null()) { normal_cnt = parsed["normal_cnt"].int_value(); }
3657  if(!parsed["face_cnt"].is_null()) { face_cnt = parsed["face_cnt"].int_value(); }
3658  if(!parsed["piece_cnt"].is_null()) { piece_cnt = parsed["piece_cnt"].int_value(); }
3659  if(!parsed["device_cnt"].is_null()) { device_cnt = parsed["device_cnt"].int_value(); }
3660  if(!parsed["port_cnt"].is_null()) { port_cnt = parsed["port_cnt"].int_value(); }
3661  if(!parsed["agent_cnt"].is_null()) { agent_cnt = parsed["agent_cnt"].int_value(); }
3662  if(!parsed["event_cnt"].is_null()) { event_cnt = parsed["event_cnt"].int_value(); }
3663  if(!parsed["target_cnt"].is_null()) { target_cnt = parsed["target_cnt"].int_value(); }
3664  if(!parsed["user_cnt"].is_null()) { user_cnt = parsed["user_cnt"].int_value(); }
3665  if(!parsed["tle_cnt"].is_null()) { tle_cnt = parsed["tle_cnt"].int_value(); }
3666 
3667  if(!parsed["flags"].is_null()) { flags = parsed["flags"].int_value(); }
3668  if(!parsed["powmode"].is_null()) { powmode = parsed["powmode"].int_value(); }
3669  if(!parsed["downtime"].is_null()) { downtime = parsed["downtime"].int_value(); }
3670  if(!parsed["azfrom"].is_null()) { azfrom = parsed["azfrom"].number_value(); }
3671  if(!parsed["elfrom"].is_null()) { elfrom = parsed["elfrom"].number_value(); }
3672  if(!parsed["azto"].is_null()) { azto = parsed["azto"].number_value(); }
3673  if(!parsed["elto"].is_null()) { elto = parsed["elto"].number_value(); }
3674  if(!parsed["range"].is_null()) { range = parsed["range"].number_value(); }
3675  if(!parsed["utcoffset"].is_null()) { utc = parsed["utcoffset"].number_value(); }
3676  if(!parsed["utc"].is_null()) { utc = parsed["utc"].number_value(); }
3677  if(!parsed["utcstart"].is_null()) { utc = parsed["utcstart"].number_value(); }
3678  if(!parsed["loc"].is_null()) { loc.from_json(parsed["loc"].dump()); }
3679  if(!parsed["phys"].is_null()) { phys.from_json(parsed["phys"].dump()); }
3680  } else {
3681  cerr<<"ERROR = "<<error<<endl;
3682  }
3683  return;
3684  }
3685 };
3686 
3688 
3692 struct devicestruc : public allstruc
3693 {
3726 
3728 
3732  return json11::Json::object {
3733  { "enabled" , enabled },
3734  { "type" , type },
3735  { "model" , model },
3736  { "flag" , static_cast<int>(flag) },
3737  { "addr" , addr },
3738  { "cidx" , cidx },
3739  { "didx" , didx },
3740  { "pidx" , pidx },
3741  { "bidx" , bidx },
3742  { "portidx" , portidx },
3743  { "namp" , namp},
3744  { "nvolt" , nvolt },
3745  { "amp" , amp },
3746  { "volt" , volt },
3747  { "power" , power },
3748  { "energy" , energy },
3749  { "drate" , drate },
3750  { "temp" , temp },
3751  { "utc" , utc },
3752 
3753  { "all" , all },
3754  { "ant" , ant },
3755  { "batt" , batt },
3756  { "bcreg" , bcreg },
3757  { "bus" , bus },
3758  { "cam" , cam },
3759  { "cpu" , cpu },
3760  { "disk" , disk },
3761  { "gps" , gps },
3762  { "htr" , htr },
3763  { "imu" , imu },
3764  { "mcc" , mcc },
3765  { "motr" , motr },
3766  { "mtr" , mtr },
3767  { "pload" , pload },
3768  { "prop" , prop },
3769  { "psen" , psen },
3770  { "pvstrg" , pvstrg },
3771  { "rot" , rot },
3772  { "rw" , rw },
3773  { "rxr" , rxr },
3774  { "ssen" , ssen },
3775  { "stt" , stt },
3776  { "suchi" , suchi },
3777  { "swch" , swch },
3778  { "tcu" , tcu },
3779  { "tcv" , tcv },
3780  { "telem" , telem },
3781  { "thst" , thst },
3782  { "tnc" , tnc },
3783  { "tsen" , tsen },
3784  { "txr" , txr }
3785  };
3786  }
3787 
3789 
3794  void from_json(const string& js) {
3795  string error;
3796  json11::Json p = json11::Json::parse(js,error);
3797  if(error.empty()) {
3798  if(!p["enabled"].is_null()) { enabled = p["enabled"].bool_value(); }
3799  if(!p["type"].is_null()) { type = p["type"].int_value(); }
3800  if(!p["model"].is_null()) { model = p["model"].int_value(); }
3801  if(!p["flag"].is_null()) { flag = p["flag"].int_value(); }
3802  if(!p["addr"].is_null()) { addr = p["addr"].int_value(); }
3803  if(!p["cidx"].is_null()) { cidx = p["cidx"].int_value(); }
3804  if(!p["didx"].is_null()) { didx = p["didx"].int_value(); }
3805  if(!p["pidx"].is_null()) { pidx = p["pidx"].int_value(); }
3806  if(!p["bidx"].is_null()) { bidx = p["bidx"].int_value(); }
3807  if(!p["portidx"].is_null()) { portidx = p["portidx"].int_value(); }
3808  if(!p["namp"].is_null()) { namp = p["namp"].number_value(); }
3809  if(!p["nvolt"].is_null()) { nvolt = p["nvolt"].number_value(); }
3810  if(!p["amp"].is_null()) { amp = p["amp"].number_value(); }
3811  if(!p["volt"].is_null()) { volt = p["volt"].number_value(); }
3812  if(!p["power"].is_null()) { power = p["power"].number_value(); }
3813  if(!p["energy"].is_null()) { energy = p["energy"].number_value(); }
3814  if(!p["drate"].is_null()) { drate = p["drate"].number_value(); }
3815  if(!p["temp"].is_null()) { temp = p["temp"].number_value(); }
3816  if(!p["utc"].is_null()) { utc = p["utc"].number_value(); }
3817 
3818  if(!p["all"].is_null()) { all.from_json(p["all"].dump()); }
3819  if(!p["ant"].is_null()) { ant.from_json(p["ant"].dump()); }
3820  if(!p["batt"].is_null()) { batt.from_json(p["batt"].dump()); }
3821  if(!p["bcreg"].is_null()) { bcreg.from_json(p["bcreg"].dump()); }
3822  if(!p["bus"].is_null()) { bus.from_json(p["bus"].dump()); }
3823  if(!p["cam"].is_null()) { cam.from_json(p["cam"].dump()); }
3824  if(!p["cpu"].is_null()) { cpu.from_json(p["cpu"].dump()); }
3825  if(!p["disk"].is_null()) { disk.from_json(p["disk"].dump()); }
3826  if(!p["gps"].is_null()) { gps.from_json(p["gps"].dump()); }
3827  if(!p["htr"].is_null()) { htr.from_json(p["htr"].dump()); }
3828  if(!p["imu"].is_null()) { imu.from_json(p["imu"].dump()); }
3829  if(!p["mcc"].is_null()) { mcc.from_json(p["mcc"].dump()); }
3830  if(!p["motr"].is_null()) { motr.from_json(p["motr"].dump()); }
3831  if(!p["mtr"].is_null()) { mtr.from_json(p["mtr"].dump()); }
3832  if(!p["pload"].is_null()) { pload.from_json(p["pload"].dump()); }
3833  if(!p["prop"].is_null()) { prop.from_json(p["prop"].dump()); }
3834  if(!p["psen"].is_null()) { psen.from_json(p["psen"].dump()); }
3835  if(!p["pvstrg"].is_null()) { pvstrg.from_json(p["pvstrg"].dump()); }
3836  if(!p["rot"].is_null()) { rot.from_json(p["rot"].dump()); }
3837  if(!p["rw"].is_null()) { rw.from_json(p["rw"].dump()); }
3838  if(!p["rxr"].is_null()) { rxr.from_json(p["rxr"].dump()); }
3839  if(!p["ssen"].is_null()) { ssen.from_json(p["ssen"].dump()); }
3840  if(!p["stt"].is_null()) { stt.from_json(p["stt"].dump()); }
3841  if(!p["suchi"].is_null()) { suchi.from_json(p["suchi"].dump()); }
3842  if(!p["swch"].is_null()) { swch.from_json(p["swch"].dump()); }
3843  if(!p["tcu"].is_null()) { tcu.from_json(p["tcu"].dump()); }
3844  if(!p["tcv"].is_null()) { tcv.from_json(p["tcv"].dump()); }
3845  if(!p["telem"].is_null()) { telem.from_json(p["telem"].dump()); }
3846  if(!p["thst"].is_null()) { thst.from_json(p["thst"].dump()); }
3847  if(!p["tnc"].is_null()) { tnc.from_json(p["tnc"].dump()); }
3848  if(!p["tsen"].is_null()) { tsen.from_json(p["tsen"].dump()); }
3849  if(!p["txr"].is_null()) { txr.from_json(p["txr"].dump()); }
3850  } else {
3851  cerr<<"ERROR: <"<<error<<">"<<endl;
3852  }
3853  return;
3854  }
3855 };
3856 
3858 
3861 {
3862  uint16_t all_cnt = 0;
3863  uint16_t ant_cnt = 0;
3864  uint16_t batt_cnt = 0;
3865  uint16_t bus_cnt = 0;
3866  uint16_t cam_cnt = 0;
3867  uint16_t cpu_cnt = 0;
3868  uint16_t disk_cnt = 0;
3869  uint16_t gps_cnt = 0;
3870  uint16_t htr_cnt = 0;
3871  uint16_t imu_cnt = 0;
3872  uint16_t mcc_cnt = 0;
3873  uint16_t motr_cnt = 0;
3874  uint16_t mtr_cnt = 0;
3875  uint16_t pload_cnt = 0;
3876  uint16_t prop_cnt = 0;
3877  uint16_t psen_cnt = 0;
3878  uint16_t bcreg_cnt = 0;
3879  uint16_t rot_cnt = 0;
3880  uint16_t rw_cnt = 0;
3881  uint16_t rxr_cnt = 0;
3882  uint16_t ssen_cnt = 0;
3883  uint16_t pvstrg_cnt = 0;
3884  uint16_t stt_cnt = 0;
3885  uint16_t suchi_cnt = 0;
3886  uint16_t swch_cnt = 0;
3887  uint16_t tcu_cnt = 0;
3888  uint16_t tcv_cnt = 0;
3889  uint16_t telem_cnt = 0;
3890  uint16_t thst_cnt = 0;
3891  uint16_t tsen_cnt = 0;
3892  uint16_t tnc_cnt = 0;
3893  uint16_t txr_cnt = 0;
3894  vector<uint16_t>all;
3895  vector<uint16_t>ant;
3896  vector<uint16_t>batt;
3897  vector<uint16_t>bcreg;
3898  vector<uint16_t>bus;
3899  vector<uint16_t>cam;
3900  vector<uint16_t>cpu;
3901  vector<uint16_t>disk;
3902  vector<uint16_t>gps;
3903  vector<uint16_t>htr;
3904  vector<uint16_t>imu;
3905  vector<uint16_t>mcc;
3906  vector<uint16_t>motr;
3907  vector<uint16_t>mtr;
3908  vector<uint16_t>pload;
3909  vector<uint16_t>prop;
3910  vector<uint16_t>psen;
3911  vector<uint16_t>pvstrg;
3912  vector<uint16_t>rot;
3913  vector<uint16_t>rw;
3914  vector<uint16_t>rxr;
3915  vector<uint16_t>ssen;
3916  vector<uint16_t>stt;
3917  vector<uint16_t>suchi;
3918  vector<uint16_t>swch;
3919  vector<uint16_t>tcu;
3920  vector<uint16_t>tcv;
3921  vector<uint16_t>telem;
3922  vector<uint16_t>thst;
3923  vector<uint16_t>tnc;
3924  vector<uint16_t>tsen;
3925  vector<uint16_t>txr;
3926 
3928 
3932  return json11::Json::object {
3933  { "all_cnt", all_cnt },
3934  { "ant_cnt", ant_cnt },
3935  { "batt_cnt", batt_cnt },
3936  { "bus_cnt", bus_cnt },
3937  { "cam_cnt", cam_cnt },
3938  { "cpu_cnt", cpu_cnt },
3939  { "disk_cnt", disk_cnt },
3940  { "gps_cnt", gps_cnt },
3941  { "htr_cnt", htr_cnt },
3942  { "imu_cnt", imu_cnt },
3943  { "mcc_cnt", mcc_cnt },
3944  { "motr_cnt", motr_cnt },
3945  { "mtr_cnt", mtr_cnt },
3946  { "pload_cnt", pload_cnt },
3947  { "prop_cnt", prop_cnt },
3948  { "psen_cnt", psen_cnt },
3949  { "bcreg_cnt", bcreg_cnt },
3950  { "rot_cnt", rot_cnt },
3951  { "rw_cnt", rw_cnt },
3952  { "rxr_cnt", rxr_cnt },
3953  { "ssen_cnt", ssen_cnt },
3954  { "pvstrg_cnt", pvstrg_cnt },
3955  { "stt_cnt", stt_cnt },
3956  { "suchi_cnt", suchi_cnt },
3957  { "swch_cnt", swch_cnt },
3958  { "tcu_cnt", tcu_cnt },
3959  { "tcv_cnt", tcv_cnt },
3960  { "telem_cnt", telem_cnt },
3961  { "thst_cnt", thst_cnt },
3962  { "tsen_cnt", tsen_cnt },
3963  { "tnc_cnt", tnc_cnt },
3964  { "txr_cnt", txr_cnt },
3965  { "all", all },
3966  { "ant", ant },
3967  { "ant", batt },
3968  { "bcreg", bcreg },
3969  { "bus", bus },
3970  { "cam", cam },
3971  { "cpu", cpu },
3972  { "disk", disk },
3973  { "gps", gps },
3974  { "htr", htr },
3975  { "imu", imu },
3976  { "mcc", mcc },
3977  { "motr", motr },
3978  { "mtr", mtr },
3979  { "pload", pload },
3980  { "prop", prop },
3981  { "psen", psen },
3982  { "pvstrg", pvstrg },
3983  { "rot", rot },
3984  { "rw", rw },
3985  { "rxr", rxr },
3986  { "ssen", ssen },
3987  { "stt", stt },
3988  { "suchi", suchi },
3989  { "swch", swch },
3990  { "tcu", tcu },
3991  { "tcv", tcv },
3992  { "telem", telem },
3993  { "thst", thst },
3994  { "tnc", tnc },
3995  { "tsen", tsen },
3996  { "txr", txr }
3997  };
3998  }
3999 
4001 
4006  void from_json(const string& s) {
4007  string error;
4008  json11::Json p = json11::Json::parse(s,error);
4009  if(error.empty()) {
4010  if(!p["all_cnt"].is_null()) { all_cnt = p["all_cnt"].int_value(); }
4011  if(!p["ant_cnt"].is_null()) { ant_cnt = p["ant_cnt"].int_value(); }
4012  if(!p["batt_cnt"].is_null()) { batt_cnt = p["batt_cnt"].int_value(); }
4013  if(!p["bus_cnt"].is_null()) { bus_cnt = p["bus_cnt"].int_value(); }
4014  if(!p["cam_cnt"].is_null()) { cam_cnt = p["cam_cnt"].int_value(); }
4015 
4016  if(!p["cpu_cnt"].is_null()) { cpu_cnt = p["cpu_cnt"].int_value(); }
4017  if(!p["disk_cnt"].is_null()) { disk_cnt = p["disk_cnt"].int_value(); }
4018  if(!p["gps_cnt"].is_null()) { gps_cnt = p["gps_cnt"].int_value(); }
4019  if(!p["htr_cnt"].is_null()) { htr_cnt = p["htr_cnt"].int_value(); }
4020  if(!p["imu_cnt"].is_null()) { imu_cnt = p["imu_cnt"].int_value(); }
4021 
4022  if(!p["mcc_cnt"].is_null()) { mcc_cnt = p["mcc_cnt"].int_value(); }
4023  if(!p["motr_cnt"].is_null()) { motr_cnt = p["motr_cnt"].int_value(); }
4024  if(!p["mtr_cnt"].is_null()) { mtr_cnt = p["mtr_cnt"].int_value(); }
4025  if(!p["pload_cnt"].is_null()) { pload_cnt = p["pload_cnt"].int_value(); }
4026  if(!p["prop_cnt"].is_null()) { prop_cnt = p["prop_cnt"].int_value(); }
4027 
4028  if(!p["psen_cnt"].is_null()) { psen_cnt = p["psen_cnt"].int_value(); }
4029  if(!p["bcreg_cnt"].is_null()) { bcreg_cnt = p["bcreg_cnt"].int_value(); }
4030  if(!p["rot_cnt"].is_null()) { rot_cnt = p["rot_cnt"].int_value(); }
4031  if(!p["rw_cnt"].is_null()) { rw_cnt = p["rw_cnt"].int_value(); }
4032  if(!p["rxr_cnt"].is_null()) { rxr_cnt = p["rxr_cnt"].int_value(); }
4033 
4034  if(!p["ssen_cnt"].is_null()) { ssen_cnt = p["ssen_cnt"].int_value(); }
4035  if(!p["pvstrg_cnt"].is_null()) { pvstrg_cnt = p["pvstrg_cnt"].int_value(); }
4036  if(!p["stt_cnt"].is_null()) { stt_cnt = p["stt_cnt"].int_value(); }
4037  if(!p["suchi_cnt"].is_null()) { suchi_cnt = p["suchi_cnt"].int_value(); }
4038  if(!p["swch_cnt"].is_null()) { swch_cnt = p["swch_cnt"].int_value(); }
4039 
4040  if(!p["tcu_cnt"].is_null()) { tcu_cnt = p["tcu_cnt"].int_value(); }
4041  if(!p["tcv_cnt"].is_null()) { tcv_cnt = p["tcv_cnt"].int_value(); }
4042  if(!p["telem_cnt"].is_null()) { telem_cnt = p["telem_cnt"].int_value(); }
4043  if(!p["thst_cnt"].is_null()) { thst_cnt = p["thst_cnt"].int_value(); }
4044  if(!p["tsen_cnt"].is_null()) { tsen_cnt = p["tsen_cnt"].int_value(); }
4045 
4046  if(!p["tnc_cnt"].is_null()) { tnc_cnt = p["tnc_cnt"].int_value(); }
4047  if(!p["txr_cnt"].is_null()) { txr_cnt = p["txr_cnt"].int_value(); }
4048 
4049  for(size_t i = 0; i < all.size(); ++i) {
4050  if(!p["all"][i].is_null()) { all[i] = p["all"][i].int_value(); }
4051  }
4052  for(size_t i = 0; i < ant.size(); ++i) {
4053  if(!p["ant"][i].is_null()) { ant[i] = p["ant"][i].int_value(); }
4054  }
4055  for(size_t i = 0; i < batt.size(); ++i) {
4056  if(!p["batt"][i].is_null()) { batt[i] = p["batt"][i].int_value(); }
4057  }
4058  for(size_t i = 0; i < bcreg.size(); ++i) {
4059  if(!p["bcreg"][i].is_null()) { bcreg[i] = p["bcreg"][i].int_value(); }
4060  }
4061  for(size_t i = 0; i < bus.size(); ++i) {
4062  if(!p["bus"][i].is_null()) { bus[i] = p["bus"][i].int_value(); }
4063  }
4064 
4065  for(size_t i = 0; i < cam.size(); ++i) {
4066  if(!p["cam"][i].is_null()) { cam[i] = p["cam"][i].int_value(); }
4067  }
4068  for(size_t i = 0; i < cpu.size(); ++i) {
4069  if(!p["cpu"][i].is_null()) { cpu[i] = p["cpu"][i].int_value(); }
4070  }
4071  for(size_t i = 0; i < disk.size(); ++i) {
4072  if(!p["disk"][i].is_null()) { disk[i] = p["disk"][i].int_value(); }
4073  }
4074  for(size_t i = 0; i < gps.size(); ++i) {
4075  if(!p["gps"][i].is_null()) { gps[i] = p["gps"][i].int_value(); }
4076  }
4077  for(size_t i = 0; i < htr.size(); ++i) {
4078  if(!p["htr"][i].is_null()) { htr[i] = p["htr"][i].int_value(); }
4079  }
4080 
4081  for(size_t i = 0; i < imu.size(); ++i) {
4082  if(!p["imu"][i].is_null()) { imu[i] = p["imu"][i].int_value(); }
4083  }
4084  for(size_t i = 0; i < mcc.size(); ++i) {
4085  if(!p["mcc"][i].is_null()) { mcc[i] = p["mcc"][i].int_value(); }
4086  }
4087  for(size_t i = 0; i < motr.size(); ++i) {
4088  if(!p["motr"][i].is_null()) { motr[i] = p["motr"][i].int_value(); }
4089  }
4090  for(size_t i = 0; i < mtr.size(); ++i) {
4091  if(!p["mtr"][i].is_null()) { mtr[i] = p["mtr"][i].int_value(); }
4092  }
4093  for(size_t i = 0; i < pload.size(); ++i) {
4094  if(!p["pload"][i].is_null()) { pload[i] = p["pload"][i].int_value(); }
4095  }
4096 
4097  for(size_t i = 0; i < prop.size(); ++i) {
4098  if(!p["prop"][i].is_null()) { prop[i] = p["prop"][i].int_value(); }
4099  }
4100  for(size_t i = 0; i < psen.size(); ++i) {
4101  if(!p["psen"][i].is_null()) { psen[i] = p["psen"][i].int_value(); }
4102  }
4103  for(size_t i = 0; i < pvstrg.size(); ++i) {
4104  if(!p["pvstrg"][i].is_null()) { pvstrg[i] = p["pvstrg"][i].int_value(); }
4105  }
4106  for(size_t i = 0; i < rot.size(); ++i) {
4107  if(!p["rot"][i].is_null()) { rot[i] = p["rot"][i].int_value(); }
4108  }
4109  for(size_t i = 0; i < rw.size(); ++i) {
4110  if(!p["rw"][i].is_null()) { rw[i] = p["rw"][i].int_value(); }
4111  }
4112 
4113  for(size_t i = 0; i < rxr.size(); ++i) {
4114  if(!p["rxr"][i].is_null()) { rxr[i] = p["rxr"][i].int_value(); }
4115  }
4116  for(size_t i = 0; i < ssen.size(); ++i) {
4117  if(!p["ssen"][i].is_null()) { ssen[i] = p["ssen"][i].int_value(); }
4118  }
4119  for(size_t i = 0; i < stt.size(); ++i) {
4120  if(!p["stt"][i].is_null()) { stt[i] = p["stt"][i].int_value(); }
4121  }
4122  for(size_t i = 0; i < suchi.size(); ++i) {
4123  if(!p["suchi"][i].is_null()) { suchi[i] = p["suchi"][i].int_value(); }
4124  }
4125  for(size_t i = 0; i < swch.size(); ++i) {
4126  if(!p["swch"][i].is_null()) { swch[i] = p["swch"][i].int_value(); }
4127  }
4128 
4129  for(size_t i = 0; i < tcu.size(); ++i) {
4130  if(!p["tcu"][i].is_null()) { tcu[i] = p["tcu"][i].int_value(); }
4131  }
4132  for(size_t i = 0; i < tcv.size(); ++i) {
4133  if(!p["tcv"][i].is_null()) { tcv[i] = p["tcv"][i].int_value(); }
4134  }
4135  for(size_t i = 0; i < telem.size(); ++i) {
4136  if(!p["telem"][i].is_null()) { telem[i] = p["telem"][i].int_value(); }
4137  }
4138  for(size_t i = 0; i < thst.size(); ++i) {
4139  if(!p["thst"][i].is_null()) { thst[i] = p["thst"][i].int_value(); }
4140  }
4141  for(size_t i = 0; i < tnc.size(); ++i) {
4142  if(!p["tnc"][i].is_null()) { tnc[i] = p["tnc"][i].int_value(); }
4143  }
4144 
4145  for(size_t i = 0; i < tsen.size(); ++i) {
4146  if(!p["tsen"][i].is_null()) { tsen[i] = p["tsen"][i].int_value(); }
4147  }
4148  for(size_t i = 0; i < txr.size(); ++i) {
4149  if(!p["txr"][i].is_null()) { txr[i] = p["txr"][i].int_value(); }
4150  }
4151  } else {
4152  cerr<<"ERROR: <"<<error<<">"<<endl;
4153  }
4154  return;
4155  }
4156 };
4157 
4159 
4165 {
4167  bool enabled = true;
4169  uint16_t type = 0;
4171  uint16_t group = 0;
4173  string name = "";
4175  ptrdiff_t offset = 0;
4177  uint8_t* ptr = 0;
4179  vector <uint8_t> data;
4181  uint16_t unit_index = 0;
4183  uint16_t alert_index = 0;
4185  uint16_t alarm_index = 0;
4187  uint16_t maximum_index = 0;
4189  uint16_t minimum_index = 0;
4191  uint16_t subsystem = 0;
4192 };
4193 
4194 //void replace(std::string& str, const std::string& from, const std::string& to);
4195 //vector<size_t> find_newlines(const string& sample);
4196 //void pretty_form(string& js);
4197 
4198 
4200 {
4202  double timestamp = 0.;
4203 
4205  uint16_t jmapped = 0;
4206 
4208  vector<vector<jsonentry> > jmap; // depricate me!
4209 
4211  vector<vector<jsonequation> > emap; // depricate me?
4212 
4214  vector<vector<unitstruc> > unit;
4215 
4217  vector<equationstruc> equation;
4218 
4221 
4223  vector <vertexstruc> vertexs;
4224 
4226  vector <vertexstruc> normals;
4227 
4229  vector <facestruc> faces;
4230 
4232  vector<piecestruc> pieces;
4233 
4236 
4238  vector<devicestruc> device;
4239 
4242 
4244  vector<portstruc> port;
4245 
4247  vector<agentstruc> agent;
4248 
4250  vector<eventstruc> event;
4251 
4253  vector<targetstruc> target;
4254 
4256  vector<userstruc> user;
4257 
4259  vector<tlestruc> tle;
4260 
4263 
4264 
4266 
4267  // fictional mass and density
4268  double mass = 1.0;
4269  double dens = 1.0;
4270 
4271  // position
4272  double t_pos = 0.0;
4273  double x_pos = 0.0;
4274  double y_pos = 0.0;
4275  double z_pos = 0.0;
4276 
4277  // velocity
4278  double t_vel = 0.0;
4279  double x_vel = 0.0;
4280  double y_vel = 0.0;
4281  double z_vel = 0.0;
4282 
4283  // acceleration
4284  double t_acc = 0.0;
4285  double x_acc = 0.0;
4286  double y_acc = 0.0;
4287  double z_acc = 0.0;
4288 
4289  // waypoint
4290  double t_way = 0.0;
4291  double x_way = 0.0;
4292  double y_way = 0.0;
4293  double z_way = 0.0;
4294 
4295  // attitude
4296  double pitch = 0.0;
4297  double roll = 0.0;
4298  double yaw = 0.0;
4299 
4300  // orbital elements
4301 
4302  // epoch (do i wanna do it this way?)
4303 
4304  // initial position
4305  //double x_0_pos = 0.0;
4306  //double y_0_pos = 0.0;
4307  //double z_0_pos = 0.0;
4308 
4309  // initial velocity
4310  //double x_0_vel = 0.0;
4311  //double y_0_vel = 0.0;
4312  //double z_0_vel = 0.0;
4313 
4314  // t0 = time of epoch
4315  //double t0 = 0.0;
4316  // v0 = true anomaly of epoch
4317  //double v0 = 0.0;
4318 
4319  // a = semi-major axis (m)
4320  double a = 0.0;
4321  // e = eccentricity
4322  double e = 0.0;
4323 
4324  // BONUS ROUND
4325 
4326  // b = semi-minor axis (m)
4327  double b = a*sqrt(1.0 - pow(e,2.0));
4328 
4329  // l = semi-latus rectum = h^2/mu = b^2/a = a*(1-e^2) = wow!
4330  double l = a*(1.0-pow(e,2.0));
4331 
4332 
4333  // i = inclination (radians)
4334  double i = 0.0;
4335  // O = longitude of the right ascending node (radians)
4336  double O = 0.0;
4337  // w = argument of the periapsis (radians)
4338  double w = 0.0;
4339  // tau = time of periapsis passage (seconds)
4340  double tau = 0.0;
4341 
4342 
4343  // G = gravitational constant = 6.67430(15)*10^(−11) m3â‹…kg–1â‹…s–2
4344  double G = 6.6743015e-11;
4345 
4346  // M = Mass of the Earth = 5.9722*10^24 kg
4347  double mass_of_Earth = 5.9722e24;
4348 
4349  // mu = standard gravitational parameter (m3/s2)
4350  double mu = G * mass_of_Earth;
4351 
4352  // n = mean angular motion (rad/s) [ used to find a in TLEs ]
4353  double n = pow( (mu / pow(a,3.0) ), (0.5) );
4354 
4355  // T = period of orbit (seconds)
4356  double T = ( 2.0 * M_PI ) / n;
4357 
4358  // t = current time (should this be seconds? or days?)
4359  double t = 0.0;
4360 
4361  // M = mean anamoly
4362  //double M = n * (t - tau);
4363  double M = fmod(n * (t - tau), 2*M_PI);
4364 
4365  // v = true anomaly (Fourier approximation)
4366  double v = M + (2.0*e-0.25*pow(e,3.0))*sin(M) + 1.25*pow(e,2.0)*sin(2.0*M) + (13.0/12.0)*pow(e,3.0)*sin(3.0*M);
4367 
4368  // r(v(t)) = radius (distance from focus of attraction to orbiting body)
4369  double r = l / (1.0 + e*cos(v));
4370 
4371  // position at time t in perifocal co-ords (as function of v(t))
4372  double P_pos_t = r * cos(v);
4373  double Q_pos_t = r * sin(v);
4374  double W_pos_t = 0.0;
4375 
4376  // velocity at time t in perifocal co-ords (as function of v(t))
4377  double P_vel_t = sqrt(mu/l) * -sin(v);
4378  double Q_vel_t = sqrt(mu/l) * (e+cos(v));
4379  double W_vel_t = 0.0;
4380 
4381  // rotation matrix from perifocal to equitorial coordinates (R_row_col)
4382 
4383  // |R_0_0 R_0_1 R_0_2| [ P ] [I]
4384  // |R_1_0 R_1_1 R_1_2|* | Q | ==> |J|
4385  // |R_2_0 R_2_1 R_2_2| [ W ] [K]
4386 
4387  // (inverse transform is the transpose of R)
4388 
4389  double R_0_0 = 0.0;
4390  double R_1_0 = 0.0;
4391  double R_2_0 = 0.0;
4392 
4393  double R_0_1 = 0.0;
4394  double R_1_1 = 0.0;
4395  double R_2_1 = 0.0;
4396 
4397  double R_0_2 = 0.0;
4398  double R_1_2 = 0.0;
4399  double R_2_2 = 0.0;
4400 
4402  R_0_0 = -sin(O)*cos(i)*sin(w) + cos(O)*cos(w);
4403  R_0_1 = -sin(O)*cos(i)*cos(w) - cos(O)*sin(w);
4404  R_0_2 = sin(O)*sin(i);
4405 
4406  R_1_0 = cos(O)*cos(i)*sin(w) + sin(O)*cos(w);
4407  R_1_1 = cos(O)*cos(i)*cos(w) - sin(O)*sin(w);
4408  R_1_2 = -cos(O)*sin(i);
4409 
4410  R_2_0 = sin(i)*sin(w);
4411  R_2_1 = sin(i)*cos(w);
4412  R_2_2 = cos(i);
4413  return;
4414  }
4415 
4416  // equatorial co-ordinates (ECI)
4417  double I_pos_t = 0.0;
4418  double J_pos_t = 0.0;
4419  double K_pos_t = 0.0;
4420  double I_vel_t = 0.0;
4421  double J_vel_t = 0.0;
4422  double K_vel_t = 0.0;
4423 
4424  // set location
4425  void set_PQW(double time) {
4426 
4427 // to find position and velocity at time t
4428  // 0 Make sure all necessary orbital elements are set
4429  t = time;
4430  l = a*(1.0-pow(e,2.0));
4431  // 1 Calculate mean anamoly (M)
4432  M = fmod(n * (t - tau), 2*M_PI);
4433  // 2 Calculate true anamoly (v)
4434  v = M + (2.0*e-0.25*pow(e,3.0))*sin(M) + 1.25*pow(e,2.0)*sin(2.0*M) + (13.0/12.0)*pow(e,3.0)*sin(3.0*M);
4435  // 3 Calculate radius (r)
4436  r = l / (1.0 + e*cos(v));
4437  // 4 Calculate position vector <P_pos_t, Q_pos_t, W_pos_t>
4438  P_pos_t = r * cos(v);
4439  Q_pos_t = r * sin(v);
4440  W_pos_t = 0.0;
4441  P_vel_t = sqrt(mu/l) * -sin(v);
4442  //Q_vel_t = sqrt(mu/l) * (e+cos(v))*sin(v);
4443  Q_vel_t = sqrt(mu/l) * (e+cos(v));
4444  W_vel_t = 0.0;
4445 
4446  return;
4447 
4448  }
4449 
4450  // perifocal to geocentric equatorial co-ordinate conversion
4452  set_up_rotation_matrix();
4453  I_pos_t = R_0_0 * P_pos_t + R_0_1 * Q_pos_t + R_0_2 * W_pos_t;
4454  J_pos_t = R_1_0 * P_pos_t + R_1_1 * Q_pos_t + R_1_2 * W_pos_t;
4455  K_pos_t = R_2_0 * P_pos_t + R_2_1 * Q_pos_t + R_2_2 * W_pos_t;
4456 
4457  I_vel_t = R_0_0 * P_vel_t + R_0_1 * Q_vel_t + R_0_2 * W_vel_t;
4458  J_vel_t = R_1_0 * P_vel_t + R_1_1 * Q_vel_t + R_1_2 * W_vel_t;
4459  K_vel_t = R_2_0 * P_vel_t + R_2_1 * Q_vel_t + R_2_2 * W_vel_t;
4460  return;
4461  }
4462 
4463  // geocentric equatorial to perifocal co-ordinate conversion
4465  set_up_rotation_matrix();
4466  P_pos_t = R_0_0 * I_pos_t + R_1_0 * J_pos_t + R_2_0 * K_pos_t;
4467  Q_pos_t = R_0_1 * I_pos_t + R_1_1 * J_pos_t + R_2_1 * K_pos_t;
4468  W_pos_t = R_0_2 * I_pos_t + R_1_2 * J_pos_t + R_2_2 * K_pos_t;
4469 
4470  P_vel_t = R_0_0 * I_vel_t + R_1_0 * J_vel_t + R_2_0 * K_vel_t;
4471  Q_vel_t = R_0_1 * I_vel_t + R_1_1 * J_vel_t + R_2_1 * K_vel_t;
4472  W_vel_t = R_0_2 * I_vel_t + R_1_2 * J_vel_t + R_2_2 * K_vel_t;
4473  return;
4474  }
4475 
4476 
4477  // orbital equations
4478 
4479  // to find position and velocity at time t
4480  // 0 Make sure all orbital elements are set
4481  // 1 Calculate mean anamoly (M)
4482  // 2 Calculate true anamoly (v)
4483  // 3 Calculate radius (r)
4484  // 4 Calculate position vector <P_pos_t, Q_pos_t, R_pos_t>
4485  // 5 Calculate velocity vector <P_vel_t, Q_vel_t, R_vel_t>
4486  // 6 Transform perifocal (PQW) co-ords to geocentric equatorial (IJK) co-ords
4487 
4488 
4489 
4490 
4492 
4493  using name_map = map<string,void*>;
4494  using name_mapping = pair<string,void*>;
4495 
4496  using type_map = map<string,string>;
4497  using type_mapping = pair<string,string>;
4498 
4501 
4503 
4508  bool name_exists(const string& s) { return (names.find(s) == names.end()) ? false : true; }
4509 
4511 
4514  size_t size() { return names.size(); }
4515 
4517 
4520  void print_all_names() const {
4521  name_map::const_iterator it = names.begin();
4522  while(it != names.end()) { cout<<(it++)->first<<endl; }
4523  }
4524 
4526 
4529  void print_all_names_types() const {
4530  name_map::const_iterator n = names.begin();
4531  while(n != names.end()) {
4532  type_map::const_iterator t = types.find(n->first);
4533  if(t == types.end()) {
4534  cout<<left<<setw(40)<<(n++)->first<<endl;
4535  } else {
4536  cout<<left<<setw(40)<<(n++)->first<<t->second<<endl;
4537  }
4538  }
4539  return;
4540  }
4541 
4543 
4548  name_map::const_iterator n = names.begin();
4549  while(n != names.end()) {
4550  type_map::const_iterator t = types.find(n->first);
4551  if(t == types.end()) {
4552  cout<<left<<setw(40)<<(n++)->first<<endl;
4553  } else {
4554  cout<<left<<setw(40)<<(n++)->first<<left<<setw(16)<<t->second;
4555  if(t->second=="double") {
4556  cout<<left<<setw(32)<<setprecision(std::numeric_limits<double>::digits10)<<fixed<<get_value<double>(t->first)<<endl;
4557  } else if(t->second=="float") {
4558  cout<<left<<setw(32)<<setprecision(std::numeric_limits<float>::digits10)<<fixed<<get_value<float>(t->first)<<endl;
4559  } else if(t->second=="int") {
4560  cout<<left<<setw(32)<<get_value<int>(t->first)<<endl;
4561  } else if(t->second=="uint32_t") {
4562  cout<<left<<setw(32)<<get_value<uint32_t>(t->first)<<endl;
4563  } else if(t->second=="int32_t") {
4564  cout<<left<<setw(32)<<get_value<int32_t>(t->first)<<endl;
4565  } else if(t->second=="uint16_t") {
4566  cout<<left<<setw(32)<<get_value<uint16_t>(t->first)<<endl;
4567  } else if(t->second=="int16_t") {
4568  cout<<left<<setw(32)<<get_value<int16_t>(t->first)<<endl;
4569  } else if(t->second=="uint8_t") {
4570  cout<<left<<setw(32)<<get_value<uint8_t>(t->first)<<endl;
4571  } else if(t->second=="int8_t") {
4572  cout<<left<<setw(32)<<get_value<int8_t>(t->first)<<endl;
4573  } else if(t->second=="size_t") {
4574  cout<<left<<setw(32)<<get_value<size_t>(t->first)<<endl;
4575  } else if(t->second=="bool") {
4576  cout<<left<<setw(32)<<get_value<bool>(t->first)<<endl;
4577  } else if(t->second=="string") {
4578  cout<<left<<setw(32)<<get_value<string>(t->first)<<endl;
4579  } else {
4580  cout<<endl;
4581  }
4582  }
4583  }
4584  return;
4585  }
4586 
4588 
4591  vector<string> get_all_names() const {
4592  vector<string> all_names;
4593  name_map::const_iterator it = names.begin();
4594  while(it != names.end()) { all_names.push_back((it++)->first); }
4595  return all_names;
4596  }
4597 
4598  // deprecate for now to force types to be known for all names
4599  //void add_name(const string& s, void* v) { names.insert(name_mapping(s,v)); };
4600 
4602 
4611  void add_name(const string& s, void* v, string t) {
4612  names.insert(name_mapping(s,v));
4613  types.insert(type_mapping(s,t));
4614  };
4615  //TODO: change_name(..) functions, match_name(), find_aliases(), etc
4616 
4618 
4623  void remove_name(const string& s) {
4624  names.erase(s);
4625  types.erase(s);
4626  }
4627 
4629 
4634  void remove_name_recursive(const string& s) {
4635  auto p = names.lower_bound(s);
4636  auto q = names.end();
4637  const string sbracket = s + "[";
4638  const string sdot = s + ".";
4639 
4640  // search through name map for names of the object/collection and its members
4641  while (p != q) {
4642  if (p->first.compare(s) == 0 || // if exact match s is found. eg: "jmap" but not "jmapped"
4643  p->first.compare(0, sbracket.size(), sbracket) == 0 || // if search string s + [ is found. eg: "jmap[0]"
4644  p->first.compare(0, sdot.size(), sdot) == 0) { // if search string s + . is found. eg: "node.name"
4645  names.erase(p++);
4646  } else {
4647  ++p;
4648  }
4649  }
4650 
4651  auto p2 = types.lower_bound(s);
4652  auto q2 = types.end();
4653  while (p2 != q2) {
4654  if (p2->first.compare(s) == 0 || // if exact match s is found. eg: "jmap" but not "jmapped"
4655  p2->first.compare(0, sbracket.size(), sbracket) == 0 || // if search string s + [ is found. eg: "jmap[0]"
4656  p2->first.compare(0, sdot.size(), sdot) == 0) { // if search string s + . is found. eg: "node.name"
4657  types.erase(p2++);
4658  } else {
4659  ++p2;
4660  }
4661  }
4662 
4663  }
4664 
4666 
4672 
4673  // default names for Simulation
4674  add_name("mass", &mass, "double");
4675  add_name("density", &dens, "double");
4676 
4677  add_name("t_position", &t_pos, "double");
4678  add_name("x_position", &x_pos, "double");
4679  add_name("y_position", &y_pos, "double");
4680  add_name("z_position", &z_pos, "double");
4681 
4682  add_name("t_velocity", &t_vel, "double");
4683  add_name("x_velocity", &x_vel, "double");
4684  add_name("y_velocity", &y_vel, "double");
4685  add_name("z_velocity", &z_vel, "double");
4686 
4687  add_name("t_acceleration", &t_acc, "double");
4688  add_name("x_acceleration", &x_acc, "double");
4689  add_name("y_acceleration", &y_acc, "double");
4690  add_name("z_acceleration", &z_acc, "double");
4691 
4692  add_name("t_waypoint", &t_way, "double");
4693  add_name("x_waypoint", &x_way, "double");
4694  add_name("y_waypoint", &y_way, "double");
4695  add_name("z_waypoint", &z_way, "double");
4696 
4697  add_name("pitch", &pitch, "double");
4698  add_name("roll", &roll, "double");
4699  add_name("yaw", &yaw, "double");
4700 
4701 
4702  // the whole she-bang
4703  add_name("cinfo", this, "cosmosstruc");
4704 
4705  // double timestamp
4706  add_name("timestamp", &timestamp, "double");
4707 
4708  // uint16_t jmapped
4709  add_name("jmapped", &jmapped, "uint16_t");
4710 
4711  // vector<vector<unitstruc>> unit
4712  add_name("unit", &unit, "vector<vector<unitstruc>>");
4713  for(size_t i = 0; i < unit.capacity(); ++i) {
4714  string basename = "unit[" + std::to_string(i) + "]";
4715  add_name(basename, &unit[i], "vector<unitstruc>");
4716  for(size_t j = 0; j < unit[i].capacity(); ++j) {
4717  string rebasename = basename + "[" + std::to_string(j) + "]";
4718  add_name(rebasename, &unit[i][j], "unitstruc");
4719  add_name(rebasename+".name", &unit[i][j].name, "string");
4720  add_name(rebasename+".type", &unit[i][j].type, "uint16_t");
4721  add_name(rebasename+".p0", &unit[i][j].p0, "float");
4722  add_name(rebasename+".p1", &unit[i][j].p1, "float");
4723  add_name(rebasename+".p2", &unit[i][j].p2, "float");
4724  }
4725  }
4726 
4727 
4728  // vector<equationstruc> equation
4729  add_name("equation", &equation, "vector<equationstruc>");
4730  for(size_t i = 0; i < equation.capacity(); ++i) {
4731  string basename = "equation[" + std::to_string(i) + "]";
4732  add_name(basename, &equation[i], "equationstruc");
4733  add_name(basename+".name", &equation[i].name, "string");
4734  add_name(basename+".value", &equation[i].value, "string");
4735  }
4736 
4737  // nodestruc node
4738  add_name("node", &node, "nodestruc");
4739  add_name("node.name", &node.name, "char[]");
4740  add_name("node.lastevent", &node.lastevent, "char[]");
4741  add_name("node.lasteventutc", &node.lasteventutc, "double");
4742  add_name("node.type", &node.type, "uint16_t");
4743  add_name("node.state", &node.state, "uint16_t");
4744  add_name("node.vertex_cnt", &node.vertex_cnt, "uint16_t");
4745  add_name("node.normal_cnt", &node.normal_cnt, "uint16_t");
4746  add_name("node.face_cnt", &node.face_cnt, "uint16_t");
4747  add_name("node.piece_cnt", &node.piece_cnt, "uint16_t");
4748  add_name("node.device_cnt", &node.device_cnt, "uint16_t");
4749  add_name("node.port_cnt", &node.port_cnt, "uint16_t");
4750  add_name("node.agent_cnt", &node.agent_cnt, "uint16_t");
4751  add_name("node.event_cnt", &node.event_cnt, "uint16_t");
4752  add_name("node.target_cnt", &node.target_cnt, "uint16_t");
4753  add_name("node.user_cnt", &node.user_cnt, "uint16_t");
4754  add_name("node.tle_cnt", &node.tle_cnt, "uint16_t");
4755  add_name("node.flags", &node.flags, "uint16_t");
4756  add_name("node.powmode", &node.powmode, "int16_t");
4757  add_name("node.downtime", &node.downtime, "uint32_t");
4758  add_name("node.azfrom", &node.azfrom, "float");
4759  add_name("node.elfrom", &node.elfrom, "float");
4760  add_name("node.azto", &node.azto, "float");
4761  add_name("node.elto", &node.elto, "float");
4762  add_name("node.range", &node.range, "float");
4763  add_name("node.utcoffset", &node.utcoffset, "double");
4764  add_name("node.utc", &node.utc, "double");
4765  add_name("node.utcstart", &node.utcstart, "double");
4766  add_name("node.loc", &node.loc, "locstruc");
4767  add_name("node.loc.utc", &node.loc.utc, "double");
4768  add_name("node.loc.pos", &node.loc.pos, "posstruc");
4769  add_name("node.loc.pos.utc", &node.loc.pos.utc, "double");
4770  add_name("node.loc.pos.icrf", &node.loc.pos.icrf, "cartpos");
4771  add_name("node.loc.pos.icrf.utc", &node.loc.pos.icrf.utc, "double");
4772  add_name("node.loc.pos.icrf.s", &node.loc.pos.icrf.s, "rvector");
4773  add_name("node.loc.pos.icrf.s.col", &node.loc.pos.icrf.s.col, "double[]");
4774  for(size_t i = 0; i < sizeof(node.loc.pos.icrf.s.col)/sizeof(node.loc.pos.icrf.s.col[0]); ++i) {
4775  string basename = "node.loc.pos.icrf.s.col[" + std::to_string(i) + "]";
4776  add_name(basename, &node.loc.pos.icrf.s.col[i], "double");
4777  }
4778  add_name("node.loc.pos.icrf.v", &node.loc.pos.icrf.v, "rvector");
4779  add_name("node.loc.pos.icrf.v.col", &node.loc.pos.icrf.v.col, "double[]");
4780  for(size_t i = 0; i < sizeof(node.loc.pos.icrf.v.col)/sizeof(node.loc.pos.icrf.v.col[0]); ++i) {
4781  string basename = "node.loc.pos.icrf.v.col[" + std::to_string(i) + "]";
4782  add_name(basename, &node.loc.pos.icrf.v.col[i], "double");
4783  }
4784  add_name("node.loc.pos.icrf.a", &node.loc.pos.icrf.a, "rvector");
4785  add_name("node.loc.pos.icrf.a.col", &node.loc.pos.icrf.a.col, "double[]");
4786  for(size_t i = 0; i < sizeof(node.loc.pos.icrf.a.col)/sizeof(node.loc.pos.icrf.a.col[0]); ++i) {
4787  string basename = "node.loc.pos.icrf.a.col[" + std::to_string(i) + "]";
4788  add_name(basename, &node.loc.pos.icrf.a.col[i], "double");
4789  }
4790  add_name("node.loc.pos.icrf.pass", &node.loc.pos.icrf.pass, "uint32_t");
4791  add_name("node.loc.pos.eci", &node.loc.pos.eci, "cartpos");
4792  add_name("node.loc.pos.eci.utc", &node.loc.pos.eci.utc, "double");
4793  add_name("node.loc.pos.eci.s", &node.loc.pos.eci.s, "rvector");
4794  add_name("node.loc.pos.eci.s.col", &node.loc.pos.eci.s.col, "double[]");
4795  for(size_t i = 0; i < sizeof(node.loc.pos.eci.s.col)/sizeof(node.loc.pos.eci.s.col[0]); ++i) {
4796  string basename = "node.loc.pos.eci.s.col[" + std::to_string(i) + "]";
4797  add_name(basename, &node.loc.pos.eci.s.col[i], "double");
4798  }
4799  add_name("node.loc.pos.eci.v", &node.loc.pos.eci.v, "rvector");
4800  add_name("node.loc.pos.eci.v.col", &node.loc.pos.eci.v.col, "double[]");
4801  for(size_t i = 0; i < sizeof(node.loc.pos.eci.v.col)/sizeof(node.loc.pos.eci.v.col[0]); ++i) {
4802  string basename = "node.loc.pos.eci.v.col[" + std::to_string(i) + "]";
4803  add_name(basename, &node.loc.pos.eci.v.col[i], "double");
4804  }
4805  add_name("node.loc.pos.eci.a", &node.loc.pos.eci.a, "rvector");
4806  add_name("node.loc.pos.eci.a.col", &node.loc.pos.eci.a.col, "double[]");
4807  for(size_t i = 0; i < sizeof(node.loc.pos.eci.a.col)/sizeof(node.loc.pos.eci.a.col[0]); ++i) {
4808  string basename = "node.loc.pos.eci.a.col[" + std::to_string(i) + "]";
4809  add_name(basename, &node.loc.pos.eci.a.col[i], "double");
4810  }
4811  add_name("node.loc.pos.eci.pass", &node.loc.pos.eci.pass, "uint32_t");
4812  add_name("node.loc.pos.sci", &node.loc.pos.sci, "cartpos");
4813  add_name("node.loc.pos.sci.utc", &node.loc.pos.sci.utc, "double");
4814  add_name("node.loc.pos.sci.s", &node.loc.pos.sci.s, "rvector");
4815  add_name("node.loc.pos.sci.s.col", &node.loc.pos.sci.s.col, "double[]");
4816  for(size_t i = 0; i < sizeof(node.loc.pos.sci.s.col)/sizeof(node.loc.pos.sci.s.col[0]); ++i) {
4817  string basename = "node.loc.pos.sci.s.col[" + std::to_string(i) + "]";
4818  add_name(basename, &node.loc.pos.sci.s.col[i], "double");
4819  }
4820  add_name("node.loc.pos.sci.v", &node.loc.pos.sci.v, "rvector");
4821  add_name("node.loc.pos.sci.v.col", &node.loc.pos.sci.v.col, "double[]");
4822  for(size_t i = 0; i < sizeof(node.loc.pos.sci.v.col)/sizeof(node.loc.pos.sci.v.col[0]); ++i) {
4823  string basename = "node.loc.pos.sci.v.col[" + std::to_string(i) + "]";
4824  add_name(basename, &node.loc.pos.sci.v.col[i], "double");
4825  }
4826  add_name("node.loc.pos.sci.a", &node.loc.pos.sci.a, "rvector");
4827  add_name("node.loc.pos.sci.a.col", &node.loc.pos.sci.a.col, "double[]");
4828  for(size_t i = 0; i < sizeof(node.loc.pos.sci.a.col)/sizeof(node.loc.pos.sci.a.col[0]); ++i) {
4829  string basename = "node.loc.pos.sci.a.col[" + std::to_string(i) + "]";
4830  add_name(basename, &node.loc.pos.sci.a.col[i], "double");
4831  }
4832  add_name("node.loc.pos.sci.pass", &node.loc.pos.sci.pass, "uint32_t");
4833  add_name("node.loc.pos.geoc", &node.loc.pos.geoc, "cartpos");
4834  add_name("node.loc.pos.geoc.utc", &node.loc.pos.geoc.utc, "double");
4835  add_name("node.loc.pos.geoc.s", &node.loc.pos.geoc.s, "rvector");
4836  add_name("node.loc.pos.geoc.s.col", &node.loc.pos.geoc.s.col, "double[]");
4837  for(size_t i = 0; i < sizeof(node.loc.pos.geoc.s.col)/sizeof(node.loc.pos.geoc.s.col[0]); ++i) {
4838  string basename = "node.loc.pos.geoc.s.col[" + std::to_string(i) + "]";
4839  add_name(basename, &node.loc.pos.geoc.s.col[i], "double");
4840  }
4841  add_name("node.loc.pos.geoc.v", &node.loc.pos.geoc.v, "rvector");
4842  add_name("node.loc.pos.geoc.v.col", &node.loc.pos.geoc.v.col, "double[]");
4843  for(size_t i = 0; i < sizeof(node.loc.pos.geoc.v.col)/sizeof(node.loc.pos.geoc.v.col[0]); ++i) {
4844  string basename = "node.loc.pos.geoc.v.col[" + std::to_string(i) + "]";
4845  add_name(basename, &node.loc.pos.geoc.v.col[i], "double");
4846  }
4847  add_name("node.loc.pos.geoc.a", &node.loc.pos.geoc.a, "rvector");
4848  add_name("node.loc.pos.geoc.a.col", &node.loc.pos.geoc.a.col, "double[]");
4849  for(size_t i = 0; i < sizeof(node.loc.pos.geoc.a.col)/sizeof(node.loc.pos.geoc.a.col[0]); ++i) {
4850  string basename = "node.loc.pos.geoc.a.col[" + std::to_string(i) + "]";
4851  add_name(basename, &node.loc.pos.geoc.a.col[i], "double");
4852  }
4853  add_name("node.loc.pos.geoc.pass", &node.loc.pos.geoc.pass, "uint32_t");
4854  add_name("node.loc.pos.selc", &node.loc.pos.selc, "cartpos");
4855  add_name("node.loc.pos.selc.utc", &node.loc.pos.selc.utc, "double");
4856  add_name("node.loc.pos.selc.s", &node.loc.pos.selc.s, "rvector");
4857  add_name("node.loc.pos.selc.s.col", &node.loc.pos.selc.s.col, "double[]");
4858  for(size_t i = 0; i < sizeof(node.loc.pos.selc.s.col)/sizeof(node.loc.pos.selc.s.col[0]); ++i) {
4859  string basename = "node.loc.pos.selc.s.col[" + std::to_string(i) + "]";
4860  add_name(basename, &node.loc.pos.selc.s.col[i], "double");
4861  }
4862  add_name("node.loc.pos.selc.v", &node.loc.pos.selc.v, "rvector");
4863  add_name("node.loc.pos.selc.v.col", &node.loc.pos.selc.v.col, "double[]");
4864  for(size_t i = 0; i < sizeof(node.loc.pos.selc.v.col)/sizeof(node.loc.pos.selc.v.col[0]); ++i) {
4865  string basename = "node.loc.pos.selc.v.col[" + std::to_string(i) + "]";
4866  add_name(basename, &node.loc.pos.selc.v.col[i], "double");
4867  }
4868  add_name("node.loc.pos.selc.a", &node.loc.pos.selc.a, "rvector");
4869  add_name("node.loc.pos.selc.a.col", &node.loc.pos.selc.a.col, "double[]");
4870  for(size_t i = 0; i < sizeof(node.loc.pos.selc.a.col)/sizeof(node.loc.pos.selc.a.col[0]); ++i) {
4871  string basename = "node.loc.pos.selc.a.col[" + std::to_string(i) + "]";
4872  add_name(basename, &node.loc.pos.selc.a.col[i], "double");
4873  }
4874  add_name("node.loc.pos.selc.pass", &node.loc.pos.selc.pass, "uint32_t");
4875  add_name("node.loc.pos.geod", &node.loc.pos.geod, "geoidpos");
4876  add_name("node.loc.pos.geod.utc", &node.loc.pos.geod.utc, "double");
4877  add_name("node.loc.pos.geod.s", &node.loc.pos.geod.s, "gvector");
4878  add_name("node.loc.pos.geod.s.lat", &node.loc.pos.geod.s.lat, "double");
4879  add_name("node.loc.pos.geod.s.lon", &node.loc.pos.geod.s.lon, "double");
4880  add_name("node.loc.pos.geod.s.h", &node.loc.pos.geod.s.h, "double");
4881  add_name("node.loc.pos.geod.v", &node.loc.pos.geod.v, "gvector");
4882  add_name("node.loc.pos.geod.v.lat", &node.loc.pos.geod.v.lat, "double");
4883  add_name("node.loc.pos.geod.v.lon", &node.loc.pos.geod.v.lon, "double");
4884  add_name("node.loc.pos.geod.v.h", &node.loc.pos.geod.v.h, "double");
4885  add_name("node.loc.pos.geod.a", &node.loc.pos.geod.a, "gvector");
4886  add_name("node.loc.pos.geod.a.lat", &node.loc.pos.geod.a.lat, "double");
4887  add_name("node.loc.pos.geod.a.lon", &node.loc.pos.geod.a.lon, "double");
4888  add_name("node.loc.pos.geod.a.h", &node.loc.pos.geod.a.h, "double");
4889  add_name("node.loc.pos.geod.pass", &node.loc.pos.geod.pass, "uint32_t");
4890  add_name("node.loc.pos.selg", &node.loc.pos.selg, "geoidpos");
4891  add_name("node.loc.pos.selg.utc", &node.loc.pos.selg.utc, "double");
4892  add_name("node.loc.pos.selg.s", &node.loc.pos.selg.s, "gvector");
4893  add_name("node.loc.pos.selg.s.lat", &node.loc.pos.selg.s.lat, "double");
4894  add_name("node.loc.pos.selg.s.lon", &node.loc.pos.selg.s.lon, "double");
4895  add_name("node.loc.pos.selg.s.h", &node.loc.pos.selg.s.h, "double");
4896  add_name("node.loc.pos.selg.v", &node.loc.pos.selg.v, "gvector");
4897  add_name("node.loc.pos.selg.v.lat", &node.loc.pos.selg.v.lat, "double");
4898  add_name("node.loc.pos.selg.v.lon", &node.loc.pos.selg.v.lon, "double");
4899  add_name("node.loc.pos.selg.v.h", &node.loc.pos.selg.v.h, "double");
4900  add_name("node.loc.pos.selg.a", &node.loc.pos.selg.a, "gvector");
4901  add_name("node.loc.pos.selg.a.lat", &node.loc.pos.selg.a.lat, "double");
4902  add_name("node.loc.pos.selg.a.lon", &node.loc.pos.selg.a.lon, "double");
4903  add_name("node.loc.pos.selg.a.h", &node.loc.pos.selg.a.h, "double");
4904  add_name("node.loc.pos.selg.pass", &node.loc.pos.selg.pass, "uint32_t");
4905  add_name("node.loc.pos.geos", &node.loc.pos.geos, "spherpos");
4906  add_name("node.loc.pos.geos.utc", &node.loc.pos.geos.utc, "double");
4907  add_name("node.loc.pos.geos.s", &node.loc.pos.geos.s, "svector");
4908  add_name("node.loc.pos.geos.s.phi", &node.loc.pos.geos.s.phi, "double");
4909  add_name("node.loc.pos.geos.s.lambda", &node.loc.pos.geos.s.lambda, "double");
4910  add_name("node.loc.pos.geos.s.r", &node.loc.pos.geos.s.r, "double");
4911  add_name("node.loc.pos.geos.v", &node.loc.pos.geos.v, "svector");
4912  add_name("node.loc.pos.geos.v.phi", &node.loc.pos.geos.v.phi, "double");
4913  add_name("node.loc.pos.geos.v.lambda", &node.loc.pos.geos.v.lambda, "double");
4914  add_name("node.loc.pos.geos.v.r", &node.loc.pos.geos.v.r, "double");
4915  add_name("node.loc.pos.geos.a", &node.loc.pos.geos.a, "svector");
4916  add_name("node.loc.pos.geos.a.phi", &node.loc.pos.geos.a.phi, "double");
4917  add_name("node.loc.pos.geos.a.lambda", &node.loc.pos.geos.a.lambda, "double");
4918  add_name("node.loc.pos.geos.a.r", &node.loc.pos.geos.a.r, "double");
4919  add_name("node.loc.pos.geos.pass", &node.loc.pos.geos.pass, "uint32_t");
4920  add_name("node.loc.pos.extra", &node.loc.pos.extra, "extrapos");
4921  add_name("node.loc.pos.extra.utc", &node.loc.pos.extra.utc, "double");
4922  add_name("node.loc.pos.extra.tt", &node.loc.pos.extra.tt, "double");
4923  add_name("node.loc.pos.extra.ut", &node.loc.pos.extra.ut, "double");
4924  add_name("node.loc.pos.extra.tdb", &node.loc.pos.extra.tdb, "double");
4925  add_name("node.loc.pos.extra.j2e", &node.loc.pos.extra.j2e, "rmatrix");
4926  add_name("node.loc.pos.extra.j2e.row", &node.loc.pos.extra.j2e.row, "rvector[]");
4927  for(size_t i = 0; i < sizeof(node.loc.pos.extra.j2e.row)/sizeof(node.loc.pos.extra.j2e.row[0]); ++i) {
4928  string basename = "node.loc.pos.extra.j2e.row[" + std::to_string(i) + "]";
4929  add_name(basename, &node.loc.pos.extra.j2e.row[i], "rvector");
4930  add_name(basename+".col", &node.loc.pos.extra.j2e.row[i].col, "double[]");
4931  for(size_t j = 0; j < sizeof(node.loc.pos.extra.j2e.row[i].col)/sizeof(node.loc.pos.extra.j2e.row[i].col[0]); ++j) {
4932  string rebasename = basename + ".col[" + std::to_string(j) + "]";
4933  add_name(rebasename, &node.loc.pos.extra.j2e.row[i].col[j], "double");
4934  }
4935  }
4936  add_name("node.loc.pos.extra.dj2e", &node.loc.pos.extra.dj2e, "rmatrix");
4937  add_name("node.loc.pos.extra.dj2e.row", &node.loc.pos.extra.dj2e.row, "rvector[]");
4938  for(size_t i = 0; i < sizeof(node.loc.pos.extra.dj2e.row)/sizeof(node.loc.pos.extra.dj2e.row[0]); ++i) {
4939  string basename = "node.loc.pos.extra.dj2e.row[" + std::to_string(i) + "]";
4940  add_name(basename, &node.loc.pos.extra.dj2e.row[i], "rvector");
4941  add_name(basename+".col", &node.loc.pos.extra.dj2e.row[i].col, "double[]");
4942  for(size_t j = 0; j < sizeof(node.loc.pos.extra.dj2e.row[i].col)/sizeof(node.loc.pos.extra.dj2e.row[i].col[0]); ++j) {
4943  string rebasename = basename + ".col[" + std::to_string(j) + "]";
4944  add_name(rebasename, &node.loc.pos.extra.dj2e.row[i].col[j], "double");
4945  }
4946  }
4947  add_name("node.loc.pos.extra.ddj2e", &node.loc.pos.extra.ddj2e, "rmatrix");
4948  add_name("node.loc.pos.extra.ddj2e.row", &node.loc.pos.extra.ddj2e.row, "rvector[]");
4949  for(size_t i = 0; i < sizeof(node.loc.pos.extra.ddj2e.row)/sizeof(node.loc.pos.extra.ddj2e.row[0]); ++i) {
4950  string basename = "node.loc.pos.extra.ddj2e.row[" + std::to_string(i) + "]";
4951  add_name(basename, &node.loc.pos.extra.ddj2e.row[i], "rvector");
4952  add_name(basename+".col", &node.loc.pos.extra.ddj2e.row[i].col, "double[]");
4953  for(size_t j = 0; j < sizeof(node.loc.pos.extra.ddj2e.row[i].col)/sizeof(node.loc.pos.extra.ddj2e.row[i].col[0]); ++j) {
4954  string rebasename = basename + ".col[" + std::to_string(j) + "]";
4955  add_name(rebasename, &node.loc.pos.extra.ddj2e.row[i].col[j], "double");
4956  }
4957  }
4958  add_name("node.loc.pos.extra.e2j", &node.loc.pos.extra.e2j, "rmatrix");
4959  add_name("node.loc.pos.extra.e2j.row", &node.loc.pos.extra.e2j.row, "rvector[]");
4960  for(size_t i = 0; i < sizeof(node.loc.pos.extra.e2j.row)/sizeof(node.loc.pos.extra.e2j.row[0]); ++i) {
4961  string basename = "node.loc.pos.extra.e2j.row[" + std::to_string(i) + "]";
4962  add_name(basename, &node.loc.pos.extra.e2j.row[i], "rvector");
4963  add_name(basename+".col", &node.loc.pos.extra.e2j.row[i].col, "double[]");
4964  for(size_t j = 0; j < sizeof(node.loc.pos.extra.e2j.row[i].col)/sizeof(node.loc.pos.extra.e2j.row[i].col[0]); ++j) {
4965  string rebasename = basename + ".col[" + std::to_string(j) + "]";
4966  add_name(rebasename, &node.loc.pos.extra.e2j.row[i].col[j], "double");
4967  }
4968  }
4969  add_name("node.loc.pos.extra.de2j", &node.loc.pos.extra.de2j, "rmatrix");
4970  add_name("node.loc.pos.extra.de2j.row", &node.loc.pos.extra.de2j.row, "rvector[]");
4971  for(size_t i = 0; i < sizeof(node.loc.pos.extra.de2j.row)/sizeof(node.loc.pos.extra.de2j.row[0]); ++i) {
4972  string basename = "node.loc.pos.extra.de2j.row[" + std::to_string(i) + "]";
4973  add_name(basename, &node.loc.pos.extra.de2j.row[i], "rvector");
4974  add_name(basename+".col", &node.loc.pos.extra.de2j.row[i].col, "double[]");
4975  for(size_t j = 0; j < sizeof(node.loc.pos.extra.de2j.row[i].col)/sizeof(node.loc.pos.extra.de2j.row[i].col[0]); ++j) {
4976  string rebasename = basename + ".col[" + std::to_string(j) + "]";
4977  add_name(rebasename, &node.loc.pos.extra.de2j.row[i].col[j], "double");
4978  }
4979  }
4980  add_name("node.loc.pos.extra.dde2j", &node.loc.pos.extra.dde2j, "rmatrix");
4981  add_name("node.loc.pos.extra.dde2j.row", &node.loc.pos.extra.dde2j.row, "rvector[]");
4982  for(size_t i = 0; i < sizeof(node.loc.pos.extra.dde2j.row)/sizeof(node.loc.pos.extra.dde2j.row[0]); ++i) {
4983  string basename = "node.loc.pos.extra.dde2j.row[" + std::to_string(i) + "]";
4984  add_name(basename, &node.loc.pos.extra.dde2j.row[i], "rvector");
4985  add_name(basename+".col", &node.loc.pos.extra.dde2j.row[i].col, "double[]");
4986  for(size_t j = 0; j < sizeof(node.loc.pos.extra.dde2j.row[i].col)/sizeof(node.loc.pos.extra.dde2j.row[i].col[0]); ++j) {
4987  string rebasename = basename + ".col[" + std::to_string(j) + "]";
4988  add_name(rebasename, &node.loc.pos.extra.dde2j.row[i].col[j], "double");
4989  }
4990  }
4991  add_name("node.loc.pos.extra.j2t", &node.loc.pos.extra.j2t, "rmatrix");
4992  add_name("node.loc.pos.extra.j2t.row", &node.loc.pos.extra.j2t.row, "rvector[]");
4993  for(size_t i = 0; i < sizeof(node.loc.pos.extra.j2t.row)/sizeof(node.loc.pos.extra.j2t.row[0]); ++i) {
4994  string basename = "node.loc.pos.extra.j2t.row[" + std::to_string(i) + "]";
4995  add_name(basename, &node.loc.pos.extra.j2t.row[i], "rvector");
4996  add_name(basename+".col", &node.loc.pos.extra.j2t.row[i].col, "double[]");
4997  for(size_t j = 0; j < sizeof(node.loc.pos.extra.j2t.row[i].col)/sizeof(node.loc.pos.extra.j2t.row[i].col[0]); ++j) {
4998  string rebasename = basename + ".col[" + std::to_string(j) + "]";
4999  add_name(rebasename, &node.loc.pos.extra.j2t.row[i].col[j], "double");
5000  }
5001  }
5002  add_name("node.loc.pos.extra.j2s", &node.loc.pos.extra.j2s, "rmatrix");
5003  add_name("node.loc.pos.extra.j2s.row", &node.loc.pos.extra.j2s.row, "rvector[]");
5004  for(size_t i = 0; i < sizeof(node.loc.pos.extra.j2s.row)/sizeof(node.loc.pos.extra.j2s.row[0]); ++i) {
5005  string basename = "node.loc.pos.extra.j2s.row[" + std::to_string(i) + "]";
5006  add_name(basename, &node.loc.pos.extra.j2s.row[i], "rvector");
5007  add_name(basename+".col", &node.loc.pos.extra.j2s.row[i].col, "double[]");
5008  for(size_t j = 0; j < sizeof(node.loc.pos.extra.j2s.row[i].col)/sizeof(node.loc.pos.extra.j2s.row[i].col[0]); ++j) {
5009  string rebasename = basename + ".col[" + std::to_string(j) + "]";
5010  add_name(rebasename, &node.loc.pos.extra.j2s.row[i].col[j], "double");
5011  }
5012  }
5013  add_name("node.loc.pos.extra.t2j", &node.loc.pos.extra.t2j, "rmatrix");
5014  add_name("node.loc.pos.extra.t2j.row", &node.loc.pos.extra.t2j.row, "rvector[]");
5015  for(size_t i = 0; i < sizeof(node.loc.pos.extra.t2j.row)/sizeof(node.loc.pos.extra.t2j.row[0]); ++i) {
5016  string basename = "node.loc.pos.extra.t2j.row[" + std::to_string(i) + "]";
5017  add_name(basename, &node.loc.pos.extra.t2j.row[i], "rvector");
5018  add_name(basename+".col", &node.loc.pos.extra.t2j.row[i].col, "double[]");
5019  for(size_t j = 0; j < sizeof(node.loc.pos.extra.t2j.row[i].col)/sizeof(node.loc.pos.extra.t2j.row[i].col[0]); ++j) {
5020  string rebasename = basename + ".col[" + std::to_string(j) + "]";
5021  add_name(rebasename, &node.loc.pos.extra.t2j.row[i].col[j], "double");
5022  }
5023  }
5024  add_name("node.loc.pos.extra.s2j", &node.loc.pos.extra.s2j, "rmatrix");
5025  add_name("node.loc.pos.extra.s2j.row", &node.loc.pos.extra.s2j.row, "rvector[]");
5026  for(size_t i = 0; i < sizeof(node.loc.pos.extra.s2j.row)/sizeof(node.loc.pos.extra.s2j.row[0]); ++i) {
5027  string basename = "node.loc.pos.extra.s2j.row[" + std::to_string(i) + "]";
5028  add_name(basename, &node.loc.pos.extra.s2j.row[i], "rvector");
5029  add_name(basename+".col", &node.loc.pos.extra.s2j.row[i].col, "double[]");
5030  for(size_t j = 0; j < sizeof(node.loc.pos.extra.s2j.row[i].col)/sizeof(node.loc.pos.extra.s2j.row[i].col[0]); ++j) {
5031  string rebasename = basename + ".col[" + std::to_string(j) + "]";
5032  add_name(rebasename, &node.loc.pos.extra.s2j.row[i].col[j], "double");
5033  }
5034  }
5035  add_name("node.loc.pos.extra.s2t", &node.loc.pos.extra.s2t, "rmatrix");
5036  add_name("node.loc.pos.extra.s2t.row", &node.loc.pos.extra.s2t.row, "rvector[]");
5037  for(size_t i = 0; i < sizeof(node.loc.pos.extra.s2t.row)/sizeof(node.loc.pos.extra.s2t.row[0]); ++i) {
5038  string basename = "node.loc.pos.extra.s2t.row[" + std::to_string(i) + "]";
5039  add_name(basename, &node.loc.pos.extra.s2t.row[i], "rvector");
5040  add_name(basename+".col", &node.loc.pos.extra.s2t.row[i].col, "double[]");
5041  for(size_t j = 0; j < sizeof(node.loc.pos.extra.s2t.row[i].col)/sizeof(node.loc.pos.extra.s2t.row[i].col[0]); ++j) {
5042  string rebasename = basename + ".col[" + std::to_string(j) + "]";
5043  add_name(rebasename, &node.loc.pos.extra.s2t.row[i].col[j], "double");
5044  }
5045  }
5046  add_name("node.loc.pos.extra.ds2t", &node.loc.pos.extra.ds2t, "rmatrix");
5047  add_name("node.loc.pos.extra.ds2t.row", &node.loc.pos.extra.ds2t.row, "rvector[]");
5048  for(size_t i = 0; i < sizeof(node.loc.pos.extra.ds2t.row)/sizeof(node.loc.pos.extra.ds2t.row[0]); ++i) {
5049  string basename = "node.loc.pos.extra.ds2t.row[" + std::to_string(i) + "]";
5050  add_name(basename, &node.loc.pos.extra.ds2t.row[i], "rvector");
5051  add_name(basename+".col", &node.loc.pos.extra.ds2t.row[i].col, "double[]");
5052  for(size_t j = 0; j < sizeof(node.loc.pos.extra.ds2t.row[i].col)/sizeof(node.loc.pos.extra.ds2t.row[i].col[0]); ++j) {
5053  string rebasename = basename + ".col[" + std::to_string(j) + "]";
5054  add_name(rebasename, &node.loc.pos.extra.ds2t.row[i].col[j], "double");
5055  }
5056  }
5057  add_name("node.loc.pos.extra.t2s", &node.loc.pos.extra.t2s, "rmatrix");
5058  add_name("node.loc.pos.extra.t2s.row", &node.loc.pos.extra.t2s.row, "rvector[]");
5059  for(size_t i = 0; i < sizeof(node.loc.pos.extra.t2s.row)/sizeof(node.loc.pos.extra.t2s.row[0]); ++i) {
5060  string basename = "node.loc.pos.extra.t2s.row[" + std::to_string(i) + "]";
5061  add_name(basename, &node.loc.pos.extra.t2s.row[i], "rvector");
5062  add_name(basename+".col", &node.loc.pos.extra.t2s.row[i].col, "double[]");
5063  for(size_t j = 0; j < sizeof(node.loc.pos.extra.t2s.row[i].col)/sizeof(node.loc.pos.extra.t2s.row[i].col[0]); ++j) {
5064  string rebasename = basename + ".col[" + std::to_string(j) + "]";
5065  add_name(rebasename, &node.loc.pos.extra.t2s.row[i].col[j], "double");
5066  }
5067  }
5068  add_name("node.loc.pos.extra.dt2s", &node.loc.pos.extra.dt2s, "rmatrix");
5069  add_name("node.loc.pos.extra.dt2s.row", &node.loc.pos.extra.dt2s.row, "rvector[]");
5070  for(size_t i = 0; i < sizeof(node.loc.pos.extra.dt2s.row)/sizeof(node.loc.pos.extra.dt2s.row[0]); ++i) {
5071  string basename = "node.loc.pos.extra.dt2s.row[" + std::to_string(i) + "]";
5072  add_name(basename, &node.loc.pos.extra.dt2s.row[i], "rvector");
5073  add_name(basename+".col", &node.loc.pos.extra.dt2s.row[i].col, "double[]");
5074  for(size_t j = 0; j < sizeof(node.loc.pos.extra.dt2s.row[i].col)/sizeof(node.loc.pos.extra.dt2s.row[i].col[0]); ++j) {
5075  string rebasename = basename + ".col[" + std::to_string(j) + "]";
5076  add_name(rebasename, &node.loc.pos.extra.dt2s.row[i].col[j], "double");
5077  }
5078  }
5079  add_name("node.loc.pos.extra.sun2earth", &node.loc.pos.extra.sun2earth, "cartpos");
5080  add_name("node.loc.pos.extra.sun2earth.utc", &node.loc.pos.extra.sun2earth.utc, "double");
5081  add_name("node.loc.pos.extra.sun2earth.s", &node.loc.pos.extra.sun2earth.s, "rvector");
5082  add_name("node.loc.pos.extra.sun2earth.s.col", &node.loc.pos.extra.sun2earth.s.col, "double[]");
5083  for(size_t i = 0; i < sizeof(node.loc.pos.extra.sun2earth.s.col)/sizeof(node.loc.pos.extra.sun2earth.s.col[0]); ++i) {
5084  string basename = "node.loc.pos.extra.sun2earth.s.col[" + std::to_string(i) + "]";
5085  add_name(basename, &node.loc.pos.extra.sun2earth.s.col[i], "double");
5086  }
5087  add_name("node.loc.pos.extra.sun2earth.v", &node.loc.pos.extra.sun2earth.v, "rvector");
5088  add_name("node.loc.pos.extra.sun2earth.v.col", &node.loc.pos.extra.sun2earth.v.col, "double[]");
5089  for(size_t i = 0; i < sizeof(node.loc.pos.extra.sun2earth.v.col)/sizeof(node.loc.pos.extra.sun2earth.v.col[0]); ++i) {
5090  string basename = "node.loc.pos.extra.sun2earth.v.col[" + std::to_string(i) + "]";
5091  add_name(basename, &node.loc.pos.extra.sun2earth.v.col[i], "double");
5092  }
5093  add_name("node.loc.pos.extra.sun2earth.a", &node.loc.pos.extra.sun2earth.a, "rvector");
5094  add_name("node.loc.pos.extra.sun2earth.a.col", &node.loc.pos.extra.sun2earth.a.col, "double[]");
5095  for(size_t i = 0; i < sizeof(node.loc.pos.extra.sun2earth.a.col)/sizeof(node.loc.pos.extra.sun2earth.a.col[0]); ++i) {
5096  string basename = "node.loc.pos.extra.sun2earth.a.col[" + std::to_string(i) + "]";
5097  add_name(basename, &node.loc.pos.extra.sun2earth.a.col[i], "double");
5098  }
5099  add_name("node.loc.pos.extra.sun2earth.pass", &node.loc.pos.extra.sun2earth.pass, "uint32_t");
5100  add_name("node.loc.pos.extra.sun2moon", &node.loc.pos.extra.sun2moon, "cartpos");
5101  add_name("node.loc.pos.extra.sun2moon.utc", &node.loc.pos.extra.sun2moon.utc, "double");
5102  add_name("node.loc.pos.extra.sun2moon.s", &node.loc.pos.extra.sun2moon.s, "rvector");
5103  add_name("node.loc.pos.extra.sun2moon.s.col", &node.loc.pos.extra.sun2moon.s.col, "double[]");
5104  for(size_t i = 0; i < sizeof(node.loc.pos.extra.sun2moon.s.col)/sizeof(node.loc.pos.extra.sun2moon.s.col[0]); ++i) {
5105  string basename = "node.loc.pos.extra.sun2moon.s.col[" + std::to_string(i) + "]";
5106  add_name(basename, &node.loc.pos.extra.sun2moon.s.col[i], "double");
5107  }
5108  add_name("node.loc.pos.extra.sun2moon.v", &node.loc.pos.extra.sun2moon.v, "rvector");
5109  add_name("node.loc.pos.extra.sun2moon.v.col", &node.loc.pos.extra.sun2moon.v.col, "double[]");
5110  for(size_t i = 0; i < sizeof(node.loc.pos.extra.sun2moon.v.col)/sizeof(node.loc.pos.extra.sun2moon.v.col[0]); ++i) {
5111  string basename = "node.loc.pos.extra.sun2moon.v.col[" + std::to_string(i) + "]";
5112  add_name(basename, &node.loc.pos.extra.sun2moon.v.col[i], "double");
5113  }
5114  add_name("node.loc.pos.extra.sun2moon.a", &node.loc.pos.extra.sun2moon.a, "rvector");
5115  add_name("node.loc.pos.extra.sun2moon.a.col", &node.loc.pos.extra.sun2moon.a.col, "double[]");
5116  for(size_t i = 0; i < sizeof(node.loc.pos.extra.sun2moon.a.col)/sizeof(node.loc.pos.extra.sun2moon.a.col[0]); ++i) {
5117  string basename = "node.loc.pos.extra.sun2moon.a.col[" + std::to_string(i) + "]";
5118  add_name(basename, &node.loc.pos.extra.sun2moon.a.col[i], "double");
5119  }
5120  add_name("node.loc.pos.extra.sun2moon.pass", &node.loc.pos.extra.sun2moon.pass, "uint32_t");
5121  add_name("node.loc.pos.extra.closest", &node.loc.pos.extra.closest, "uint16_t");
5122  add_name("node.loc.pos.earthsep", &node.loc.pos.earthsep, "float");
5123  add_name("node.loc.pos.moonsep", &node.loc.pos.moonsep, "float");
5124  add_name("node.loc.pos.sunsize", &node.loc.pos.sunsize, "float");
5125  add_name("node.loc.pos.sunradiance", &node.loc.pos.sunradiance, "float");
5126  add_name("node.loc.pos.bearth", &node.loc.pos.bearth, "rvector");
5127  add_name("node.loc.pos.bearth.col", &node.loc.pos.bearth.col, "double[]");
5128  for(size_t i = 0; i < sizeof(node.loc.pos.bearth.col)/sizeof(node.loc.pos.bearth.col[0]); ++i) {
5129  string basename = "node.loc.pos.bearth.col[" + std::to_string(i) + "]";
5130  add_name(basename, &node.loc.pos.bearth.col[i], "double");
5131  }
5132  add_name("node.loc.pos.orbit", &node.loc.pos.orbit, "double");
5133  add_name("node.loc.att", &node.loc.att, "attstruc");
5134  add_name("node.loc.att.utc", &node.loc.att.utc, "double");
5135  add_name("node.loc.att.topo", &node.loc.att.topo, "qatt");
5136  add_name("node.loc.att.topo.utc", &node.loc.att.topo.utc, "double");
5137  add_name("node.loc.att.topo.s", &node.loc.att.topo.s, "quaternion");
5138  add_name("node.loc.att.topo.s.d", &node.loc.att.topo.s.d, "cvector");
5139  add_name("node.loc.att.topo.s.d.x", &node.loc.att.topo.s.d.x, "double");
5140  add_name("node.loc.att.topo.s.d.y", &node.loc.att.topo.s.d.y, "double");
5141  add_name("node.loc.att.topo.s.d.z", &node.loc.att.topo.s.d.z, "double");
5142  add_name("node.loc.att.topo.s.w", &node.loc.att.topo.s.w, "double");
5143  add_name("node.loc.att.topo.v", &node.loc.att.topo.v, "rvector");
5144  add_name("node.loc.att.topo.v.col", &node.loc.att.topo.v.col, "double[]");
5145  for(size_t i = 0; i < sizeof(node.loc.att.topo.v.col)/sizeof(node.loc.att.topo.v.col[0]); ++i) {
5146  string basename = "node.loc.att.topo.v.col[" + std::to_string(i) + "]";
5147  add_name(basename, &node.loc.att.topo.v.col[i], "double");
5148  }
5149  add_name("node.loc.att.topo.a", &node.loc.att.topo.a, "rvector");
5150  add_name("node.loc.att.topo.a.col", &node.loc.att.topo.a.col, "double[]");
5151  for(size_t i = 0; i < sizeof(node.loc.att.topo.a.col)/sizeof(node.loc.att.topo.a.col[0]); ++i) {
5152  string basename = "node.loc.att.topo.a.col[" + std::to_string(i) + "]";
5153  add_name(basename, &node.loc.att.topo.a.col[i], "double");
5154  }
5155  add_name("node.loc.att.topo.pass", &node.loc.att.topo.pass, "uint32_t");
5156  add_name("node.loc.att.lvlh", &node.loc.att.lvlh, "qatt");
5157  add_name("node.loc.att.lvlh.utc", &node.loc.att.lvlh.utc, "double");
5158  add_name("node.loc.att.lvlh.s", &node.loc.att.lvlh.s, "quaternion");
5159  add_name("node.loc.att.lvlh.s.d", &node.loc.att.lvlh.s.d, "cvector");
5160  add_name("node.loc.att.lvlh.s.d.x", &node.loc.att.lvlh.s.d.x, "double");
5161  add_name("node.loc.att.lvlh.s.d.y", &node.loc.att.lvlh.s.d.y, "double");
5162  add_name("node.loc.att.lvlh.s.d.z", &node.loc.att.lvlh.s.d.z, "double");
5163  add_name("node.loc.att.lvlh.s.w", &node.loc.att.lvlh.s.w, "double");
5164  add_name("node.loc.att.lvlh.v", &node.loc.att.lvlh.v, "rvector");
5165  add_name("node.loc.att.lvlh.v.col", &node.loc.att.lvlh.v.col, "double[]");
5166  for(size_t i = 0; i < sizeof(node.loc.att.lvlh.v.col)/sizeof(node.loc.att.lvlh.v.col[0]); ++i) {
5167  string basename = "node.loc.att.lvlh.v.col[" + std::to_string(i) + "]";
5168  add_name(basename, &node.loc.att.lvlh.v.col[i], "double");
5169  }
5170  add_name("node.loc.att.lvlh.a", &node.loc.att.lvlh.a, "rvector");
5171  add_name("node.loc.att.lvlh.a.col", &node.loc.att.lvlh.a.col, "double[]");
5172  for(size_t i = 0; i < sizeof(node.loc.att.lvlh.a.col)/sizeof(node.loc.att.lvlh.a.col[0]); ++i) {
5173  string basename = "node.loc.att.lvlh.a.col[" + std::to_string(i) + "]";
5174  add_name(basename, &node.loc.att.lvlh.a.col[i], "double");
5175  }
5176  add_name("node.loc.att.lvlh.pass", &node.loc.att.lvlh.pass, "uint32_t");
5177  add_name("node.loc.att.geoc", &node.loc.att.geoc, "qatt");
5178  add_name("node.loc.att.geoc.utc", &node.loc.att.geoc.utc, "double");
5179  add_name("node.loc.att.geoc.s", &node.loc.att.geoc.s, "quaternion");
5180  add_name("node.loc.att.geoc.s.d", &node.loc.att.geoc.s.d, "cvector");
5181  add_name("node.loc.att.geoc.s.d.x", &node.loc.att.geoc.s.d.x, "double");
5182  add_name("node.loc.att.geoc.s.d.y", &node.loc.att.geoc.s.d.y, "double");
5183  add_name("node.loc.att.geoc.s.d.z", &node.loc.att.geoc.s.d.z, "double");
5184  add_name("node.loc.att.geoc.s.w", &node.loc.att.geoc.s.w, "double");
5185  add_name("node.loc.att.geoc.v", &node.loc.att.geoc.v, "rvector");
5186  add_name("node.loc.att.geoc.v.col", &node.loc.att.geoc.v.col, "double[]");
5187  for(size_t i = 0; i < sizeof(node.loc.att.geoc.v.col)/sizeof(node.loc.att.geoc.v.col[0]); ++i) {
5188  string basename = "node.loc.att.geoc.v.col[" + std::to_string(i) + "]";
5189  add_name(basename, &node.loc.att.geoc.v.col[i], "double");
5190  }
5191  add_name("node.loc.att.geoc.a", &node.loc.att.geoc.a, "rvector");
5192  add_name("node.loc.att.geoc.a.col", &node.loc.att.geoc.a.col, "double[]");
5193  for(size_t i = 0; i < sizeof(node.loc.att.geoc.a.col)/sizeof(node.loc.att.geoc.a.col[0]); ++i) {
5194  string basename = "node.loc.att.geoc.a.col[" + std::to_string(i) + "]";
5195  add_name(basename, &node.loc.att.geoc.a.col[i], "double");
5196  }
5197  add_name("node.loc.att.geoc.pass", &node.loc.att.geoc.pass, "uint32_t");
5198  add_name("node.loc.att.selc", &node.loc.att.selc, "qatt");
5199  add_name("node.loc.att.selc.utc", &node.loc.att.selc.utc, "double");
5200  add_name("node.loc.att.selc.s", &node.loc.att.selc.s, "quaternion");
5201  add_name("node.loc.att.selc.s.d", &node.loc.att.selc.s.d, "cvector");
5202  add_name("node.loc.att.selc.s.d.x", &node.loc.att.selc.s.d.x, "double");
5203  add_name("node.loc.att.selc.s.d.y", &node.loc.att.selc.s.d.y, "double");
5204  add_name("node.loc.att.selc.s.d.z", &node.loc.att.selc.s.d.z, "double");
5205  add_name("node.loc.att.selc.s.w", &node.loc.att.selc.s.w, "double");
5206  add_name("node.loc.att.selc.v", &node.loc.att.selc.v, "rvector");
5207  add_name("node.loc.att.selc.v.col", &node.loc.att.selc.v.col, "double[]");
5208  for(size_t i = 0; i < sizeof(node.loc.att.selc.v.col)/sizeof(node.loc.att.selc.v.col[0]); ++i) {
5209  string basename = "node.loc.att.selc.v.col[" + std::to_string(i) + "]";
5210  add_name(basename, &node.loc.att.selc.v.col[i], "double");
5211  }
5212  add_name("node.loc.att.selc.a", &node.loc.att.selc.a, "rvector");
5213  add_name("node.loc.att.selc.a.col", &node.loc.att.selc.a.col, "double[]");
5214  for(size_t i = 0; i < sizeof(node.loc.att.selc.a.col)/sizeof(node.loc.att.selc.a.col[0]); ++i) {
5215  string basename = "node.loc.att.selc.a.col[" + std::to_string(i) + "]";
5216  add_name(basename, &node.loc.att.selc.a.col[i], "double");
5217  }
5218  add_name("node.loc.att.selc.pass", &node.loc.att.selc.pass, "uint32_t");
5219  add_name("node.loc.att.icrf", &node.loc.att.icrf, "qatt");
5220  add_name("node.loc.att.icrf.utc", &node.loc.att.icrf.utc, "double");
5221  add_name("node.loc.att.icrf.s", &node.loc.att.icrf.s, "quaternion");
5222  add_name("node.loc.att.icrf.s.d", &node.loc.att.icrf.s.d, "cvector");
5223  add_name("node.loc.att.icrf.s.d.x", &node.loc.att.icrf.s.d.x, "double");
5224  add_name("node.loc.att.icrf.s.d.y", &node.loc.att.icrf.s.d.y, "double");
5225  add_name("node.loc.att.icrf.s.d.z", &node.loc.att.icrf.s.d.z, "double");
5226  add_name("node.loc.att.icrf.s.w", &node.loc.att.icrf.s.w, "double");
5227  add_name("node.loc.att.icrf.v", &node.loc.att.icrf.v, "rvector");
5228  add_name("node.loc.att.icrf.v.col", &node.loc.att.icrf.v.col, "double[]");
5229  for(size_t i = 0; i < sizeof(node.loc.att.icrf.v.col)/sizeof(node.loc.att.icrf.v.col[0]); ++i) {
5230  string basename = "node.loc.att.icrf.v.col[" + std::to_string(i) + "]";
5231  add_name(basename, &node.loc.att.icrf.v.col[i], "double");
5232  }
5233  add_name("node.loc.att.icrf.a", &node.loc.att.icrf.a, "rvector");
5234  add_name("node.loc.att.icrf.a.col", &node.loc.att.icrf.a.col, "double[]");
5235  for(size_t i = 0; i < sizeof(node.loc.att.icrf.a.col)/sizeof(node.loc.att.icrf.a.col[0]); ++i) {
5236  string basename = "node.loc.att.icrf.a.col[" + std::to_string(i) + "]";
5237  add_name(basename, &node.loc.att.icrf.a.col[i], "double");
5238  }
5239  add_name("node.loc.att.icrf.pass", &node.loc.att.icrf.pass, "uint32_t");
5240  add_name("node.loc.att.extra", &node.loc.att.extra, "extraatt");
5241  add_name("node.loc.att.extra.utc", &node.loc.att.extra.utc, "double");
5242  add_name("node.loc.att.extra.j2b", &node.loc.att.extra.j2b, "rmatrix");
5243  add_name("node.loc.att.extra.j2b.row", &node.loc.att.extra.j2b.row, "rvector[]");
5244  for(size_t i = 0; i < sizeof(node.loc.att.extra.j2b.row)/sizeof(node.loc.att.extra.j2b.row[0]); ++i) {
5245  string basename = "node.loc.att.extra.j2b.row[" + std::to_string(i) + "]";
5246  add_name(basename, &node.loc.att.extra.j2b.row[i], "rvector");
5247  add_name(basename+".col", &node.loc.att.extra.j2b.row[i].col, "double[]");
5248  for(size_t j = 0; j < sizeof(node.loc.att.extra.j2b.row[i].col)/sizeof(node.loc.att.extra.j2b.row[i].col[0]); ++j) {
5249  string rebasename = basename + ".col[" + std::to_string(j) + "]";
5250  add_name(rebasename, &node.loc.att.extra.j2b.row[i].col[j], "double");
5251  }
5252  }
5253  add_name("node.loc.att.extra.b2j", &node.loc.att.extra.b2j, "rmatrix");
5254  add_name("node.loc.att.extra.b2j.row", &node.loc.att.extra.b2j.row, "rvector[]");
5255  for(size_t i = 0; i < sizeof(node.loc.att.extra.b2j.row)/sizeof(node.loc.att.extra.b2j.row[0]); ++i) {
5256  string basename = "node.loc.att.extra.b2j.row[" + std::to_string(i) + "]";
5257  add_name(basename, &node.loc.att.extra.b2j.row[i], "rvector");
5258  add_name(basename+".col", &node.loc.att.extra.b2j.row[i].col, "double[]");
5259  for(size_t j = 0; j < sizeof(node.loc.att.extra.b2j.row[i].col)/sizeof(node.loc.att.extra.b2j.row[i].col[0]); ++j) {
5260  string rebasename = basename + ".col[" + std::to_string(j) + "]";
5261  add_name(rebasename, &node.loc.att.extra.b2j.row[i].col[j], "double");
5262  }
5263  }
5264  add_name("node.phys", &node.phys, "physicsstruc");
5265  add_name("node.phys.dt", &node.phys.dt, "double");
5266  add_name("node.phys.dtj", &node.phys.dtj, "double");
5267  add_name("node.phys.utc", &node.phys.utc, "double");
5268  add_name("node.phys.mjdaccel", &node.phys.mjdaccel, "double");
5269  add_name("node.phys.mjddiff", &node.phys.mjddiff, "double");
5270  add_name("node.phys.hcap", &node.phys.hcap, "float");
5271  add_name("node.phys.mass", &node.phys.mass, "float");
5272  add_name("node.phys.temp", &node.phys.temp, "float");
5273  add_name("node.phys.heat", &node.phys.heat, "float");
5274  add_name("node.phys.area", &node.phys.area, "float");
5275  add_name("node.phys.battcap", &node.phys.battcap, "float");
5276  add_name("node.phys.battlev", &node.phys.battlev, "float");
5277  add_name("node.phys.powgen", &node.phys.powgen, "float");
5278  add_name("node.phys.powuse", &node.phys.powuse, "float");
5279  add_name("node.phys.mode", &node.phys.mode, "int32_t");
5280  add_name("node.phys.ftorque", &node.phys.ftorque, "Vector");
5281  add_name("node.phys.ftorque.x", &node.phys.ftorque.x, "double");
5282  add_name("node.phys.ftorque.y", &node.phys.ftorque.y, "double");
5283  add_name("node.phys.ftorque.z", &node.phys.ftorque.z, "double");
5284  add_name("node.phys.ftorque.w", &node.phys.ftorque.w, "double");
5285  add_name("node.phys.atorque", &node.phys.atorque, "Vector");
5286  add_name("node.phys.atorque.x", &node.phys.atorque.x, "double");
5287  add_name("node.phys.atorque.y", &node.phys.atorque.y, "double");
5288  add_name("node.phys.atorque.z", &node.phys.atorque.z, "double");
5289  add_name("node.phys.atorque.w", &node.phys.atorque.w, "double");
5290  add_name("node.phys.rtorque", &node.phys.rtorque, "Vector");
5291  add_name("node.phys.rtorque.x", &node.phys.rtorque.x, "double");
5292  add_name("node.phys.rtorque.y", &node.phys.rtorque.y, "double");
5293  add_name("node.phys.rtorque.z", &node.phys.rtorque.z, "double");
5294  add_name("node.phys.rtorque.w", &node.phys.rtorque.w, "double");
5295  add_name("node.phys.gtorque", &node.phys.gtorque, "Vector");
5296  add_name("node.phys.gtorque.x", &node.phys.gtorque.x, "double");
5297  add_name("node.phys.gtorque.y", &node.phys.gtorque.y, "double");
5298  add_name("node.phys.gtorque.z", &node.phys.gtorque.z, "double");
5299  add_name("node.phys.gtorque.w", &node.phys.gtorque.w, "double");
5300  add_name("node.phys.htorque", &node.phys.htorque, "Vector");
5301  add_name("node.phys.htorque.x", &node.phys.htorque.x, "double");
5302  add_name("node.phys.htorque.y", &node.phys.htorque.y, "double");
5303  add_name("node.phys.htorque.z", &node.phys.htorque.z, "double");
5304  add_name("node.phys.htorque.w", &node.phys.htorque.w, "double");
5305  add_name("node.phys.hmomentum", &node.phys.hmomentum, "Vector");
5306  add_name("node.phys.hmomentum.x", &node.phys.hmomentum.x, "double");
5307  add_name("node.phys.hmomentum.y", &node.phys.hmomentum.y, "double");
5308  add_name("node.phys.hmomentum.z", &node.phys.hmomentum.z, "double");
5309  add_name("node.phys.hmomentum.w", &node.phys.hmomentum.w, "double");
5310  add_name("node.phys.ctorque", &node.phys.ctorque, "Vector");
5311  add_name("node.phys.ctorque.x", &node.phys.ctorque.x, "double");
5312  add_name("node.phys.ctorque.y", &node.phys.ctorque.y, "double");
5313  add_name("node.phys.ctorque.z", &node.phys.ctorque.z, "double");
5314  add_name("node.phys.ctorque.w", &node.phys.ctorque.w, "double");
5315  add_name("node.phys.fdrag", &node.phys.fdrag, "Vector");
5316  add_name("node.phys.fdrag.x", &node.phys.fdrag.x, "double");
5317  add_name("node.phys.fdrag.y", &node.phys.fdrag.y, "double");
5318  add_name("node.phys.fdrag.z", &node.phys.fdrag.z, "double");
5319  add_name("node.phys.fdrag.w", &node.phys.fdrag.w, "double");
5320  add_name("node.phys.adrag", &node.phys.adrag, "Vector");
5321  add_name("node.phys.adrag.x", &node.phys.adrag.x, "double");
5322  add_name("node.phys.adrag.y", &node.phys.adrag.y, "double");
5323  add_name("node.phys.adrag.z", &node.phys.adrag.z, "double");
5324  add_name("node.phys.adrag.w", &node.phys.adrag.w, "double");
5325  add_name("node.phys.rdrag", &node.phys.rdrag, "Vector");
5326  add_name("node.phys.rdrag.x", &node.phys.rdrag.x, "double");
5327  add_name("node.phys.rdrag.y", &node.phys.rdrag.y, "double");
5328  add_name("node.phys.rdrag.z", &node.phys.rdrag.z, "double");
5329  add_name("node.phys.rdrag.w", &node.phys.rdrag.w, "double");
5330  add_name("node.phys.thrust", &node.phys.thrust, "Vector");
5331  add_name("node.phys.thrust.x", &node.phys.thrust.x, "double");
5332  add_name("node.phys.thrust.y", &node.phys.thrust.y, "double");
5333  add_name("node.phys.thrust.z", &node.phys.thrust.z, "double");
5334  add_name("node.phys.thrust.w", &node.phys.thrust.w, "double");
5335  add_name("node.phys.moi", &node.phys.moi, "Vector");
5336  add_name("node.phys.moi.x", &node.phys.moi.x, "double");
5337  add_name("node.phys.moi.y", &node.phys.moi.y, "double");
5338  add_name("node.phys.moi.z", &node.phys.moi.z, "double");
5339  add_name("node.phys.moi.w", &node.phys.moi.w, "double");
5340  add_name("node.phys.com", &node.phys.com, "Vector");
5341  add_name("node.phys.com.x", &node.phys.com.x, "double");
5342  add_name("node.phys.com.y", &node.phys.com.y, "double");
5343  add_name("node.phys.com.z", &node.phys.com.z, "double");
5344  add_name("node.phys.com.w", &node.phys.com.w, "double");
5345  add_name("node.phys.vertices", &node.phys.vertices, "vector<Vector>");
5346  for(size_t i = 0; i < node.phys.vertices.capacity(); ++i) {
5347  string basename = "node.phys.vertices[" + std::to_string(i) + "]";
5348  add_name(basename, &node.phys.vertices[i], "Vector");
5349  add_name(basename+".x", &node.phys.vertices[i].x, "double");
5350  add_name(basename+".y", &node.phys.vertices[i].y, "double");
5351  add_name(basename+".z", &node.phys.vertices[i].z, "double");
5352  add_name(basename+".w", &node.phys.vertices[i].w, "double");
5353  }
5354  add_name("node.phys.triangles", &node.phys.triangles, "vector<trianglestruc>");
5355  for(size_t i = 0; i < node.phys.triangles.capacity(); ++i) {
5356  string basename = "node.phys.triangles[" + std::to_string(i) + "]";
5357  add_name(basename, &node.phys.triangles[i], "trianglestruc");
5358  add_name(basename+".external", &node.phys.triangles[i].external, "bool");
5359  add_name(basename+".com", &node.phys.triangles[i].com, "Vector");
5360  add_name(basename+".com.x", &node.phys.triangles[i].com.x, "double");
5361  add_name(basename+".com.y", &node.phys.triangles[i].com.y, "double");
5362  add_name(basename+".com.z", &node.phys.triangles[i].com.z, "double");
5363  add_name(basename+".com.w", &node.phys.triangles[i].com.w, "double");
5364  add_name(basename+".normal", &node.phys.triangles[i].normal, "Vector");
5365  add_name(basename+".normal.x", &node.phys.triangles[i].normal.x, "double");
5366  add_name(basename+".normal.y", &node.phys.triangles[i].normal.y, "double");
5367  add_name(basename+".normal.z", &node.phys.triangles[i].normal.z, "double");
5368  add_name(basename+".normal.w", &node.phys.triangles[i].normal.w, "double");
5369  add_name(basename+".shove", &node.phys.triangles[i].shove, "Vector");
5370  add_name(basename+".shove.x", &node.phys.triangles[i].shove.x, "double");
5371  add_name(basename+".shove.y", &node.phys.triangles[i].shove.y, "double");
5372  add_name(basename+".shove.z", &node.phys.triangles[i].shove.z, "double");
5373  add_name(basename+".shove.w", &node.phys.triangles[i].shove.w, "double");
5374  add_name(basename+".twist", &node.phys.triangles[i].twist, "Vector");
5375  add_name(basename+".twist.x", &node.phys.triangles[i].twist.x, "double");
5376  add_name(basename+".twist.y", &node.phys.triangles[i].twist.y, "double");
5377  add_name(basename+".twist.z", &node.phys.triangles[i].twist.z, "double");
5378  add_name(basename+".twist.w", &node.phys.triangles[i].twist.w, "double");
5379  add_name(basename+".pidx", &node.phys.triangles[i].pidx, "uint16_t");
5380  add_name(basename+".tidx", &node.phys.triangles[i].tidx, "uint16_t[]");
5381  for(size_t j = 0; j < sizeof(node.phys.triangles[i].tidx)/sizeof(node.phys.triangles[i].tidx[0]); ++j) {
5382  string rebasename = basename + ".tidx[" + std::to_string(j) + "]";
5383  add_name(rebasename, &node.phys.triangles[i].tidx[j], "uint16_t");
5384  }
5385  add_name(basename+".heat", &node.phys.triangles[i].heat, "float");
5386  add_name(basename+".hcap", &node.phys.triangles[i].hcap, "float");
5387  add_name(basename+".emi", &node.phys.triangles[i].emi, "float");
5388  add_name(basename+".abs", &node.phys.triangles[i].abs, "float");
5389  add_name(basename+".mass", &node.phys.triangles[i].mass, "float");
5390  add_name(basename+".temp", &node.phys.triangles[i].temp, "float");
5391  add_name(basename+".area", &node.phys.triangles[i].area, "float");
5392  add_name(basename+".perimeter", &node.phys.triangles[i].perimeter, "float");
5393  add_name(basename+".irradiation", &node.phys.triangles[i].irradiation, "float");
5394  add_name(basename+".pcell", &node.phys.triangles[i].pcell, "float");
5395  add_name(basename+".ecellbase", &node.phys.triangles[i].ecellbase, "float");
5396  add_name(basename+".ecellslope", &node.phys.triangles[i].ecellslope, "float");
5397  add_name(basename+".triangleindex", &node.phys.triangles[i].triangleindex, "vector<vector<uint16_t>>");
5398  for(size_t j = 0; j < node.phys.triangles[i].triangleindex.capacity(); ++j) {
5399  string rebasename = basename + ".triangleindex[" + std::to_string(j) + "]";
5400  add_name(rebasename, &node.phys.triangles[i].triangleindex[j], "vector<uint16_t>");
5401  for(size_t k = 0; k < node.phys.triangles[i].triangleindex[j].capacity(); ++k) {
5402  string rebasename2 = rebasename + "[" + std::to_string(k) + "]";
5403  add_name(rebasename2, &node.phys.triangles[i].triangleindex[j][k], "uint16_t");
5404  }
5405  }
5406  }
5407 
5408 
5409  // vector<vertexstruc> vertexs
5410  add_name("vertexs", &vertexs, "vector<vertexstruc>");
5411  for(size_t i = 0; i < vertexs.capacity(); ++i) {
5412  string basename = "vertexs[" + std::to_string(i) + "]";
5413  add_name(basename, &vertexs[i], "vertexstruc");
5414  add_name(basename+".x", &vertexs[i].x, "double");
5415  add_name(basename+".y", &vertexs[i].y, "double");
5416  add_name(basename+".z", &vertexs[i].z, "double");
5417  add_name(basename+".w", &vertexs[i].w, "double");
5418  }
5419 
5420  // vector<vertexstruc> normals
5421  add_name("normals", &normals, "vector<vertexstruc>");
5422  for(size_t i = 0; i < normals.capacity(); ++i) {
5423  string basename = "normals[" + std::to_string(i) + "]";
5424  add_name(basename, &normals[i], "vertexstruc");
5425  add_name(basename+".x", &normals[i].x, "double");
5426  add_name(basename+".y", &normals[i].y, "double");
5427  add_name(basename+".z", &normals[i].z, "double");
5428  add_name(basename+".w", &normals[i].w, "double");
5429  }
5430 
5431  // vector<facestruc> faces
5432  add_name("faces", &faces, "vector<facestruc>");
5433  for(size_t i = 0; i < faces.capacity(); ++i) {
5434  string basename = "faces[" + std::to_string(i) + "]";
5435  add_name(basename, &faces[i], "facestruc");
5436  add_name(basename+".vertex_cnt", &faces[i].vertex_cnt, "uint16_t");
5437  add_name(basename+".vertex_idx", &faces[i].vertex_idx, "vector<uint16_t>");
5438  for(size_t j = 0; j < faces[i].vertex_idx.capacity(); ++j) {
5439  string rebasename = basename + ".vertex_idx[" + std::to_string(j) + "]";
5440  add_name(rebasename, &faces[i].vertex_idx[j], "uint16_t");
5441  }
5442  add_name(basename+".com", &faces[i].com, "Vector");
5443  add_name(basename+".com.x", &faces[i].com.x, "double");
5444  add_name(basename+".com.y", &faces[i].com.y, "double");
5445  add_name(basename+".com.z", &faces[i].com.z, "double");
5446  add_name(basename+".com.w", &faces[i].com.w, "double");
5447  add_name(basename+".normal", &faces[i].normal, "Vector");
5448  add_name(basename+".normal.x", &faces[i].normal.x, "double");
5449  add_name(basename+".normal.y", &faces[i].normal.y, "double");
5450  add_name(basename+".normal.z", &faces[i].normal.z, "double");
5451  add_name(basename+".normal.w", &faces[i].normal.w, "double");
5452  add_name(basename+".area", &faces[i].area, "double");
5453  }
5454 
5455  // vector<piecestruc> pieces
5456  add_name("pieces", &pieces, "vector<piecestruc>");
5457  for(size_t i = 0; i < pieces.capacity(); ++i) {
5458  string basename = "pieces[" + std::to_string(i) + "]";
5459  add_name(basename, &pieces[i], "piecestruc");
5460  add_name(basename+".name", &pieces[i].name, "char[]");
5461  add_name(basename+".enabled", &pieces[i].enabled, "bool");
5462  add_name(basename+".cidx", &pieces[i].cidx, "uint16_t");
5463  add_name(basename+".density", &pieces[i].density, "float");
5464  add_name(basename+".mass", &pieces[i].mass, "float");
5465  add_name(basename+".emi", &pieces[i].emi, "float");
5466  add_name(basename+".abs", &pieces[i].abs, "float");
5467  add_name(basename+".hcap", &pieces[i].hcap, "float");
5468  add_name(basename+".hcon", &pieces[i].hcon, "float");
5469  add_name(basename+".dim", &pieces[i].dim, "float");
5470  add_name(basename+".area", &pieces[i].area, "float");
5471  add_name(basename+".volume", &pieces[i].volume, "float");
5472  add_name(basename+".face_cnt", &pieces[i].face_cnt, "uint16_t");
5473  add_name(basename+".face_idx", &pieces[i].face_idx, "vector<uint16_t>");
5474  for(size_t j = 0; j < pieces[i].face_idx.capacity(); ++j) {
5475  string rebasename = basename + ".face_idx[" + std::to_string(j) + "]";
5476  add_name(rebasename, &pieces[i].face_idx[j], "uint16_t");
5477  }
5478  add_name(basename+".com", &pieces[i].com, "Vector");
5479  add_name(basename+".com.x", &pieces[i].com.x, "double");
5480  add_name(basename+".com.y", &pieces[i].com.y, "double");
5481  add_name(basename+".com.z", &pieces[i].com.z, "double");
5482  add_name(basename+".com.w", &pieces[i].com.w, "double");
5483  add_name(basename+".shove", &pieces[i].shove, "Vector");
5484  add_name(basename+".shove.x", &pieces[i].shove.x, "double");
5485  add_name(basename+".shove.y", &pieces[i].shove.y, "double");
5486  add_name(basename+".shove.z", &pieces[i].shove.z, "double");
5487  add_name(basename+".shove.w", &pieces[i].shove.w, "double");
5488  add_name(basename+".twist", &pieces[i].twist, "Vector");
5489  add_name(basename+".twist.x", &pieces[i].twist.x, "double");
5490  add_name(basename+".twist.y", &pieces[i].twist.y, "double");
5491  add_name(basename+".twist.z", &pieces[i].twist.z, "double");
5492  add_name(basename+".twist.w", &pieces[i].twist.w, "double");
5493  add_name(basename+".heat", &pieces[i].heat, "float");
5494  add_name(basename+".temp", &pieces[i].temp, "float");
5495  add_name(basename+".insol", &pieces[i].insol, "float");
5496  add_name(basename+".material_density", &pieces[i].material_density, "float");
5497  add_name(basename+".material_ambient", &pieces[i].material_ambient, "Vector");
5498  add_name(basename+".material_ambient.x", &pieces[i].material_ambient.x, "double");
5499  add_name(basename+".material_ambient.y", &pieces[i].material_ambient.y, "double");
5500  add_name(basename+".material_ambient.z", &pieces[i].material_ambient.z, "double");
5501  add_name(basename+".material_ambient.w", &pieces[i].material_ambient.w, "double");
5502  add_name(basename+".material_diffuse", &pieces[i].material_diffuse, "Vector");
5503  add_name(basename+".material_diffuse.x", &pieces[i].material_diffuse.x, "double");
5504  add_name(basename+".material_diffuse.y", &pieces[i].material_diffuse.y, "double");
5505  add_name(basename+".material_diffuse.z", &pieces[i].material_diffuse.z, "double");
5506  add_name(basename+".material_diffuse.w", &pieces[i].material_diffuse.w, "double");
5507  add_name(basename+".material_specular", &pieces[i].material_specular, "Vector");
5508  add_name(basename+".material_specular.x", &pieces[i].material_specular.x, "double");
5509  add_name(basename+".material_specular.y", &pieces[i].material_specular.y, "double");
5510  add_name(basename+".material_specular.z", &pieces[i].material_specular.z, "double");
5511  add_name(basename+".material_specular.w", &pieces[i].material_specular.w, "double");
5512  }
5513 
5514  // wavefront obj
5515  add_name("obj", &obj, "wavefront");
5516  add_name("obj.Vg", &obj.Vg, "vector<Vector>");
5517  for(size_t i = 0; i < obj.Vg.capacity(); ++i) {
5518  string basename = "obj.Vg[" + std::to_string(i) + "]";
5519  add_name(basename, &obj.Vg[i], "Vector");
5520  add_name(basename+".x", &obj.Vg[i].x, "double");
5521  add_name(basename+".y", &obj.Vg[i].y, "double");
5522  add_name(basename+".z", &obj.Vg[i].z, "double");
5523  add_name(basename+".w", &obj.Vg[i].w, "double");
5524  }
5525  add_name("obj.Vt", &obj.Vt, "vector<Vector>");
5526  for(size_t i = 0; i < obj.Vt.capacity(); ++i) {
5527  string basename = "obj.Vt[" + std::to_string(i) + "]";
5528  add_name(basename, &obj.Vt[i], "Vector");
5529  add_name(basename+".x", &obj.Vt[i].x, "double");
5530  add_name(basename+".y", &obj.Vt[i].y, "double");
5531  add_name(basename+".z", &obj.Vt[i].z, "double");
5532  add_name(basename+".w", &obj.Vt[i].w, "double");
5533  }
5534  add_name("obj.Vn", &obj.Vn, "vector<Vector>");
5535  for(size_t i = 0; i < obj.Vn.capacity(); ++i) {
5536  string basename = "obj.Vn[" + std::to_string(i) + "]";
5537  add_name(basename, &obj.Vn[i], "Vector");
5538  add_name(basename+".x", &obj.Vn[i].x, "double");
5539  add_name(basename+".y", &obj.Vn[i].y, "double");
5540  add_name(basename+".z", &obj.Vn[i].z, "double");
5541  add_name(basename+".w", &obj.Vn[i].w, "double");
5542  }
5543  add_name("obj.Vp", &obj.Vp, "vector<Vector>");
5544  for(size_t i = 0; i < obj.Vp.capacity(); ++i) {
5545  string basename = "obj.Vp[" + std::to_string(i) + "]";
5546  add_name(basename, &obj.Vp[i], "Vector");
5547  add_name(basename+".x", &obj.Vp[i].x, "double");
5548  add_name(basename+".y", &obj.Vp[i].y, "double");
5549  add_name(basename+".z", &obj.Vp[i].z, "double");
5550  add_name(basename+".w", &obj.Vp[i].w, "double");
5551  }
5552  add_name("obj.Materials", &obj.Materials, "vector<material>");
5553  for(size_t i = 0; i < obj.Materials.capacity(); ++i) {
5554  string basename = "obj.Materials[" + std::to_string(i) + "]";
5555  add_name(basename, &obj.Materials[i], "material");
5556  add_name(basename+".name", &obj.Materials[i].name, "string");
5557  add_name(basename+".density", &obj.Materials[i].density, "float");
5558  add_name(basename+".ambient", &obj.Materials[i].ambient, "Vector");
5559  add_name(basename+".ambient.x", &obj.Materials[i].ambient.x, "double");
5560  add_name(basename+".ambient.y", &obj.Materials[i].ambient.y, "double");
5561  add_name(basename+".ambient.z", &obj.Materials[i].ambient.z, "double");
5562  add_name(basename+".ambient.w", &obj.Materials[i].ambient.w, "double");
5563  add_name(basename+".diffuse", &obj.Materials[i].diffuse, "Vector");
5564  add_name(basename+".diffuse.x", &obj.Materials[i].diffuse.x, "double");
5565  add_name(basename+".diffuse.y", &obj.Materials[i].diffuse.y, "double");
5566  add_name(basename+".diffuse.z", &obj.Materials[i].diffuse.z, "double");
5567  add_name(basename+".diffuse.w", &obj.Materials[i].diffuse.w, "double");
5568  add_name(basename+".specular", &obj.Materials[i].specular, "Vector");
5569  add_name(basename+".specular.x", &obj.Materials[i].specular.x, "double");
5570  add_name(basename+".specular.y", &obj.Materials[i].specular.y, "double");
5571  add_name(basename+".specular.z", &obj.Materials[i].specular.z, "double");
5572  add_name(basename+".specular.w", &obj.Materials[i].specular.w, "double");
5573  }
5574  add_name("obj.Points", &obj.Points, "vector<point>");
5575  for(size_t i = 0; i < obj.Points.capacity(); ++i) {
5576  string basename = "obj.Points[" + std::to_string(i) + "]";
5577  add_name(basename, &obj.Points[i], "point");
5578  add_name(basename+".groups", &obj.Points[i].groups, "vector<size_t>");
5579  for(size_t j = 0; j < obj.Points[i].groups.capacity(); ++j) {
5580  string rebasename = basename + ".groups[" + std::to_string(j) + "]";
5581  add_name(rebasename, &obj.Points[i].groups[j], "size_t");
5582  }
5583  add_name(basename+".vertex", &obj.Points[i].vertex, "size_t");
5584  }
5585  add_name("obj.Lines", &obj.Lines, "vector<line>");
5586  for(size_t i = 0; i < obj.Lines.capacity(); ++i) {
5587  string basename = "obj.Lines[" + std::to_string(i) + "]";
5588  add_name(basename, &obj.Lines[i], "line");
5589  add_name(basename+".groups", &obj.Lines[i].groups, "vector<size_t>");
5590  for(size_t j = 0; j < obj.Lines[i].groups.capacity(); ++j) {
5591  string rebasename = basename + ".groups[" + std::to_string(j) + "]";
5592  add_name(rebasename, &obj.Lines[i].groups[j], "size_t");
5593  }
5594  add_name(basename+".vertices", &obj.Lines[i].vertices, "vector<vertex>");
5595  for(size_t j = 0; j < obj.Lines[i].vertices.capacity(); ++j) {
5596  string rebasename = basename + ".vertices[" + std::to_string(j) + "]";
5597  add_name(rebasename, &obj.Lines[i].vertices[j], "vertex");
5598  add_name(rebasename+".v", &obj.Lines[i].vertices[j].v, "size_t");
5599  add_name(rebasename+".vt", &obj.Lines[i].vertices[j].vt, "size_t");
5600  add_name(rebasename+".vn", &obj.Lines[i].vertices[j].vn, "size_t");
5601  }
5602  add_name(basename+".centroid", &obj.Lines[i].centroid, "Vector");
5603  add_name(basename+".centroid.x", &obj.Lines[i].centroid.x, "double");
5604  add_name(basename+".centroid.y", &obj.Lines[i].centroid.y, "double");
5605  add_name(basename+".centroid.z", &obj.Lines[i].centroid.z, "double");
5606  add_name(basename+".centroid.w", &obj.Lines[i].centroid.w, "double");
5607  add_name(basename+".length", &obj.Lines[i].length, "double");
5608  }
5609  add_name("obj.Faces", &obj.Faces, "vector<face>");
5610  for(size_t i = 0; i < obj.Faces.capacity(); ++i) {
5611  string basename = "obj.Faces[" + std::to_string(i) + "]";
5612  add_name(basename, &obj.Faces[i], "face");
5613  add_name(basename+".groups", &obj.Faces[i].groups, "vector<size_t>");
5614  for(size_t j = 0; j < obj.Faces[i].groups.capacity(); ++j) {
5615  string rebasename = basename + ".groups[" + std::to_string(j) + "]";
5616  add_name(rebasename, &obj.Faces[i].groups[j], "size_t");
5617  }
5618  add_name(basename+".vertices", &obj.Faces[i].vertices, "vector<vertex>");
5619  for(size_t j = 0; j < obj.Faces[i].vertices.capacity(); ++j) {
5620  string rebasename = basename + ".vertices[" + std::to_string(j) + "]";
5621  add_name(rebasename, &obj.Faces[i].vertices[j], "vertex");
5622  add_name(rebasename+".v", &obj.Faces[i].vertices[j].v, "size_t");
5623  add_name(rebasename+".vt", &obj.Faces[i].vertices[j].vt, "size_t");
5624  add_name(rebasename+".vn", &obj.Faces[i].vertices[j].vn, "size_t");
5625  }
5626  add_name(basename+".com", &obj.Faces[i].com, "Vector");
5627  add_name(basename+".com.x", &obj.Faces[i].com.x, "double");
5628  add_name(basename+".com.y", &obj.Faces[i].com.y, "double");
5629  add_name(basename+".com.z", &obj.Faces[i].com.z, "double");
5630  add_name(basename+".com.w", &obj.Faces[i].com.w, "double");
5631  add_name(basename+".normal", &obj.Faces[i].normal, "Vector");
5632  add_name(basename+".normal.x", &obj.Faces[i].normal.x, "double");
5633  add_name(basename+".normal.y", &obj.Faces[i].normal.y, "double");
5634  add_name(basename+".normal.z", &obj.Faces[i].normal.z, "double");
5635  add_name(basename+".normal.w", &obj.Faces[i].normal.w, "double");
5636  add_name(basename+".area", &obj.Faces[i].area, "double");
5637  }
5638  add_name("obj.Groups", &obj.Groups, "vector<group>");
5639  for(size_t i = 0; i < obj.Groups.capacity(); ++i) {
5640  string basename = "obj.Groups[" + std::to_string(i) + "]";
5641  add_name(basename, &obj.Groups[i], "group");
5642  add_name(basename+".name", &obj.Groups[i].name, "string");
5643  add_name(basename+".materialidx", &obj.Groups[i].materialidx, "size_t");
5644  add_name(basename+".pointidx", &obj.Groups[i].pointidx, "vector<size_t>");
5645  for(size_t j = 0; j < obj.Groups[i].pointidx.capacity(); ++j) {
5646  string rebasename = basename + ".pointidx[" + std::to_string(j) + "]";
5647  add_name(rebasename, &obj.Groups[i].pointidx[j], "size_t");
5648  }
5649  add_name(basename+".lineidx", &obj.Groups[i].lineidx, "vector<size_t>");
5650  for(size_t j = 0; j < obj.Groups[i].lineidx.capacity(); ++j) {
5651  string rebasename = basename + ".lineidx[" + std::to_string(j) + "]";
5652  add_name(rebasename, &obj.Groups[i].lineidx[j], "size_t");
5653  }
5654  add_name(basename+".faceidx", &obj.Groups[i].faceidx, "vector<size_t>");
5655  for(size_t j = 0; j < obj.Groups[i].faceidx.capacity(); ++j) {
5656  string rebasename = basename + ".faceidx[" + std::to_string(j) + "]";
5657  add_name(rebasename, &obj.Groups[i].faceidx[j], "size_t");
5658  }
5659  add_name(basename+".com", &obj.Groups[i].com, "Vector");
5660  add_name(basename+".com.x", &obj.Groups[i].com.x, "double");
5661  add_name(basename+".com.y", &obj.Groups[i].com.y, "double");
5662  add_name(basename+".com.z", &obj.Groups[i].com.z, "double");
5663  add_name(basename+".com.w", &obj.Groups[i].com.w, "double");
5664  add_name(basename+".volume", &obj.Groups[i].volume, "double");
5665  }
5666 
5667  // vector<devicestruc> device
5668  add_name("device", &device, "vector<devicestruc>");
5669  for(size_t i = 0; i < device.capacity(); ++i) {
5670  string basename = "device[" + std::to_string(i) + "]";
5671  add_name(basename, &device[i], "devicestruc");
5672  add_name(basename+".all", &device[i].all, "allstruc");
5673  add_name(basename+".all.enabled", &device[i].all.enabled, "bool");
5674  add_name(basename+".all.type", &device[i].all.type, "uint16_t");
5675  add_name(basename+".all.model", &device[i].all.model, "uint16_t");
5676  add_name(basename+".all.flag", &device[i].all.flag, "uint32_t");
5677  add_name(basename+".all.addr", &device[i].all.addr, "uint16_t");
5678  add_name(basename+".all.cidx", &device[i].all.cidx, "uint16_t");
5679  add_name(basename+".all.didx", &device[i].all.didx, "uint16_t");
5680  add_name(basename+".all.pidx", &device[i].all.pidx, "uint16_t");
5681  add_name(basename+".all.bidx", &device[i].all.bidx, "uint16_t");
5682  add_name(basename+".all.portidx", &device[i].all.portidx, "uint16_t");
5683  add_name(basename+".all.namp", &device[i].all.namp, "float");
5684  add_name(basename+".all.nvolt", &device[i].all.nvolt, "float");
5685  add_name(basename+".all.amp", &device[i].all.amp, "float");
5686  add_name(basename+".all.volt", &device[i].all.volt, "float");
5687  add_name(basename+".all.power", &device[i].all.power, "float");
5688  add_name(basename+".all.energy", &device[i].all.energy, "float");
5689  add_name(basename+".all.drate", &device[i].all.drate, "float");
5690  add_name(basename+".all.temp", &device[i].all.temp, "float");
5691  add_name(basename+".all.utc", &device[i].all.utc, "double");
5692  add_name(basename+".ant", &device[i].ant, "antstruc");
5693  add_name(basename+".ant.align", &device[i].ant.align, "quaternion");
5694  add_name(basename+".ant.align.d", &device[i].ant.align.d, "cvector");
5695  add_name(basename+".ant.align.d.x", &device[i].ant.align.d.x, "double");
5696  add_name(basename+".ant.align.d.y", &device[i].ant.align.d.y, "double");
5697  add_name(basename+".ant.align.d.z", &device[i].ant.align.d.z, "double");
5698  add_name(basename+".ant.align.w", &device[i].ant.align.w, "double");
5699  add_name(basename+".ant.azim", &device[i].ant.azim, "float");
5700  add_name(basename+".ant.elev", &device[i].ant.elev, "float");
5701  add_name(basename+".ant.minelev", &device[i].ant.minelev, "float");
5702  add_name(basename+".ant.maxelev", &device[i].ant.maxelev, "float");
5703  add_name(basename+".ant.minazim", &device[i].ant.minazim, "float");
5704  add_name(basename+".ant.maxazim", &device[i].ant.maxazim, "float");
5705  add_name(basename+".ant.threshelev", &device[i].ant.threshelev, "float");
5706  add_name(basename+".batt", &device[i].batt, "battstruc");
5707  add_name(basename+".batt.capacity", &device[i].batt.capacity, "float");
5708  add_name(basename+".batt.efficiency", &device[i].batt.efficiency, "float");
5709  add_name(basename+".batt.charge", &device[i].batt.charge, "float");
5710  add_name(basename+".batt.r_in", &device[i].batt.r_in, "float");
5711  add_name(basename+".batt.r_out", &device[i].batt.r_out, "float");
5712  add_name(basename+".batt.percentage", &device[i].batt.percentage, "float");
5713  add_name(basename+".batt.time_remaining", &device[i].batt.time_remaining, "float");
5714  add_name(basename+".bcreg", &device[i].bcreg, "bcregstruc");
5715  add_name(basename+".bus", &device[i].bus, "busstruc");
5716  add_name(basename+".bus.wdt", &device[i].bus.wdt, "float");
5717  add_name(basename+".cam", &device[i].cam, "camstruc");
5718  add_name(basename+".cam.pwidth", &device[i].cam.pwidth, "uint16_t");
5719  add_name(basename+".cam.pheight", &device[i].cam.pheight, "uint16_t");
5720  add_name(basename+".cam.width", &device[i].cam.width, "float");
5721  add_name(basename+".cam.height", &device[i].cam.height, "float");
5722  add_name(basename+".cam.flength", &device[i].cam.flength, "float");
5723  add_name(basename+".cpu", &device[i].cpu, "cpustruc");
5724  add_name(basename+".cpu.uptime", &device[i].cpu.uptime, "uint32_t");
5725  add_name(basename+".cpu.load", &device[i].cpu.load, "float");
5726  add_name(basename+".cpu.maxload", &device[i].cpu.maxload, "float");
5727  add_name(basename+".cpu.maxgib", &device[i].cpu.maxgib, "float");
5728  add_name(basename+".cpu.gib", &device[i].cpu.gib, "float");
5729  add_name(basename+".cpu.boot_count", &device[i].cpu.boot_count, "uint32_t");
5730  add_name(basename+".disk", &device[i].disk, "diskstruc");
5731  add_name(basename+".disk.maxgib", &device[i].disk.maxgib, "float");
5732  add_name(basename+".disk.gib", &device[i].disk.gib, "float");
5733  add_name(basename+".disk.path", &device[i].disk.path, "char[]");
5734  add_name(basename+".gps", &device[i].gps, "gpsstruc");
5735  add_name(basename+".gps.dutc", &device[i].gps.dutc, "double");
5736  add_name(basename+".gps.geocs", &device[i].gps.geocs, "rvector");
5737  add_name(basename+".gps.geocs.col", &device[i].gps.geocs.col, "double[]");
5738  for(size_t j = 0; j < sizeof(device[i].gps.geocs.col)/sizeof(device[i].gps.geocs.col[0]); ++j) {
5739  string rebasename = basename + "gps.geocs.col[" + std::to_string(j) + "]";
5740  add_name(rebasename, &device[i].gps.geocs.col[j], "double");
5741  }
5742  add_name(basename+".gps.geocv", &device[i].gps.geocv, "rvector");
5743  add_name(basename+".gps.geocv.col", &device[i].gps.geocv.col, "double[]");
5744  for(size_t j = 0; j < sizeof(device[i].gps.geocv.col)/sizeof(device[i].gps.geocv.col[0]); ++j) {
5745  string rebasename = basename + "gps.geocv.col[" + std::to_string(j) + "]";
5746  add_name(rebasename, &device[i].gps.geocv.col[j], "double");
5747  }
5748  add_name(basename+".gps.dgeocs", &device[i].gps.dgeocs, "rvector");
5749  add_name(basename+".gps.dgeocs.col", &device[i].gps.dgeocs.col, "double[]");
5750  for(size_t j = 0; j < sizeof(device[i].gps.dgeocs.col)/sizeof(device[i].gps.dgeocs.col[0]); ++j) {
5751  string rebasename = basename + "gps.dgeocs.col[" + std::to_string(j) + "]";
5752  add_name(rebasename, &device[i].gps.dgeocs.col[j], "double");
5753  }
5754  add_name(basename+".gps.dgeocv", &device[i].gps.dgeocv, "rvector");
5755  add_name(basename+".gps.dgeocv.col", &device[i].gps.dgeocv.col, "double[]");
5756  for(size_t j = 0; j < sizeof(device[i].gps.dgeocv.col)/sizeof(device[i].gps.dgeocv.col[0]); ++j) {
5757  string rebasename = basename + "gps.dgeocv.col[" + std::to_string(j) + "]";
5758  add_name(rebasename, &device[i].gps.dgeocv.col[j], "double");
5759  }
5760  add_name(basename+".gps.geods", &device[i].gps.geods, "gvector");
5761  add_name(basename+".gps.geods.lat", &device[i].gps.geods.lat, "double");
5762  add_name(basename+".gps.geods.lon", &device[i].gps.geods.lon, "double");
5763  add_name(basename+".gps.geods.h", &device[i].gps.geods.h, "double");
5764  add_name(basename+".gps.geodv", &device[i].gps.geodv, "gvector");
5765  add_name(basename+".gps.geodv.lat", &device[i].gps.geodv.lat, "double");
5766  add_name(basename+".gps.geodv.lon", &device[i].gps.geodv.lon, "double");
5767  add_name(basename+".gps.geodv.h", &device[i].gps.geodv.h, "double");
5768  add_name(basename+".gps.dgeods", &device[i].gps.dgeods, "gvector");
5769  add_name(basename+".gps.dgeods.lat", &device[i].gps.dgeods.lat, "double");
5770  add_name(basename+".gps.dgeods.lon", &device[i].gps.dgeods.lon, "double");
5771  add_name(basename+".gps.dgeods.h", &device[i].gps.dgeods.h, "double");
5772  add_name(basename+".gps.dgeodv", &device[i].gps.dgeodv, "gvector");
5773  add_name(basename+".gps.dgeodv.lat", &device[i].gps.dgeodv.lat, "double");
5774  add_name(basename+".gps.dgeodv.lon", &device[i].gps.dgeodv.lon, "double");
5775  add_name(basename+".gps.dgeodv.h", &device[i].gps.dgeodv.h, "double");
5776  add_name(basename+".gps.heading", &device[i].gps.heading, "float");
5777  add_name(basename+".gps.sats_used", &device[i].gps.sats_used, "uint16_t");
5778  add_name(basename+".gps.sats_visible", &device[i].gps.sats_visible, "uint16_t");
5779  add_name(basename+".gps.time_status", &device[i].gps.time_status, "uint16_t");
5780  add_name(basename+".gps.position_type", &device[i].gps.position_type, "uint16_t");
5781  add_name(basename+".gps.solution_status", &device[i].gps.solution_status, "uint16_t");
5782  add_name(basename+".htr", &device[i].htr, "htrstruc");
5783  add_name(basename+".htr.state", &device[i].htr.state, "bool");
5784  add_name(basename+".htr.setvertex", &device[i].htr.setvertex, "float");
5785  add_name(basename+".imu", &device[i].imu, "imustruc");
5786  add_name(basename+".imu.align", &device[i].imu.align, "quaternion");
5787  add_name(basename+".imu.align.d", &device[i].imu.align.d, "cvector");
5788  add_name(basename+".imu.align.d.x", &device[i].imu.align.d.x, "double");
5789  add_name(basename+".imu.align.d.y", &device[i].imu.align.d.y, "double");
5790  add_name(basename+".imu.align.d.z", &device[i].imu.align.d.z, "double");
5791  add_name(basename+".imu.align.w", &device[i].imu.align.w, "double");
5792  add_name(basename+".imu.accel", &device[i].imu.accel, "rvector");
5793  add_name(basename+".imu.accel.col", &device[i].imu.accel.col, "double[]");
5794  for(size_t j = 0; j < sizeof(device[i].imu.accel.col)/sizeof(device[i].imu.accel.col[0]); ++j) {
5795  string rebasename = basename + "imu.accel.col[" + std::to_string(j) + "]";
5796  add_name(rebasename, &device[i].imu.accel.col[j], "double");
5797  }
5798  add_name(basename+".imu.theta", &device[i].imu.theta, "quaternion");
5799  add_name(basename+".imu.theta.d", &device[i].imu.theta.d, "cvector");
5800  add_name(basename+".imu.theta.d.x", &device[i].imu.theta.d.x, "double");
5801  add_name(basename+".imu.theta.d.y", &device[i].imu.theta.d.y, "double");
5802  add_name(basename+".imu.theta.d.z", &device[i].imu.theta.d.z, "double");
5803  add_name(basename+".imu.theta.w", &device[i].imu.theta.w, "double");
5804  add_name(basename+".imu.euler", &device[i].imu.euler, "avector");
5805  add_name(basename+".imu.euler.h", &device[i].imu.euler.h, "double");
5806  add_name(basename+".imu.euler.e", &device[i].imu.euler.e, "double");
5807  add_name(basename+".imu.euler.b", &device[i].imu.euler.b, "double");
5808  add_name(basename+".imu.omega", &device[i].imu.omega, "rvector");
5809  add_name(basename+".imu.omega.col", &device[i].imu.omega.col, "double[]");
5810  for(size_t j = 0; j < sizeof(device[i].imu.omega.col)/sizeof(device[i].imu.omega.col[0]); ++j) {
5811  string rebasename = basename + "imu.omega.col[" + std::to_string(j) + "]";
5812  add_name(rebasename, &device[i].imu.omega.col[j], "double");
5813  }
5814  add_name(basename+".imu.alpha", &device[i].imu.alpha, "rvector");
5815  add_name(basename+".imu.alpha.col", &device[i].imu.alpha.col, "double[]");
5816  for(size_t j = 0; j < sizeof(device[i].imu.alpha.col)/sizeof(device[i].imu.alpha.col[0]); ++j) {
5817  string rebasename = basename + "imu.alpha.col[" + std::to_string(j) + "]";
5818  add_name(rebasename, &device[i].imu.alpha.col[j], "double");
5819  }
5820  add_name(basename+".imu.mag", &device[i].imu.mag, "rvector");
5821  add_name(basename+".imu.mag.col", &device[i].imu.mag.col, "double[]");
5822  for(size_t j = 0; j < sizeof(device[i].imu.mag.col)/sizeof(device[i].imu.mag.col[0]); ++j) {
5823  string rebasename = basename + "imu.mag.col[" + std::to_string(j) + "]";
5824  add_name(rebasename, &device[i].imu.mag.col[j], "double");
5825  }
5826  add_name(basename+".imu.bdot", &device[i].imu.bdot, "rvector");
5827  add_name(basename+".imu.bdot.col", &device[i].imu.bdot.col, "double[]");
5828  for(size_t j = 0; j < sizeof(device[i].imu.bdot.col)/sizeof(device[i].imu.bdot.col[0]); ++j) {
5829  string rebasename = basename + "imu.bdot.col[" + std::to_string(j) + "]";
5830  add_name(rebasename, &device[i].imu.bdot.col[j], "double");
5831  }
5832  add_name(basename+".mcc", &device[i].mcc, "mccstruc");
5833  add_name(basename+".mcc.align", &device[i].mcc.align, "quaternion");
5834  add_name(basename+".mcc.align.d", &device[i].mcc.align.d, "cvector");
5835  add_name(basename+".mcc.align.d.x", &device[i].mcc.align.d.x, "double");
5836  add_name(basename+".mcc.align.d.y", &device[i].mcc.align.d.y, "double");
5837  add_name(basename+".mcc.align.d.z", &device[i].mcc.align.d.z, "double");
5838  add_name(basename+".mcc.align.w", &device[i].mcc.align.w, "double");
5839  add_name(basename+".mcc.q", &device[i].mcc.q, "quaternion");
5840  add_name(basename+".mcc.q.d", &device[i].mcc.q.d, "cvector");
5841  add_name(basename+".mcc.q.d.x", &device[i].mcc.q.d.x, "double");
5842  add_name(basename+".mcc.q.d.y", &device[i].mcc.q.d.y, "double");
5843  add_name(basename+".mcc.q.d.z", &device[i].mcc.q.d.z, "double");
5844  add_name(basename+".mcc.q.w", &device[i].mcc.q.w, "double");
5845  add_name(basename+".mcc.o", &device[i].mcc.o, "rvector");
5846  add_name(basename+".mcc.o.col", &device[i].mcc.o.col, "double[]");
5847  for(size_t j = 0; j < sizeof(device[i].mcc.o.col)/sizeof(device[i].mcc.o.col[0]); ++j) {
5848  string rebasename = basename + "mcc.o.col[" + std::to_string(j) + "]";
5849  add_name(rebasename, &device[i].mcc.o.col[j], "double");
5850  }
5851  add_name(basename+".mcc.a", &device[i].mcc.a, "rvector");
5852  add_name(basename+".mcc.a.col", &device[i].mcc.a.col, "double[]");
5853  for(size_t j = 0; j < sizeof(device[i].mcc.a.col)/sizeof(device[i].mcc.a.col[0]); ++j) {
5854  string rebasename = basename + "mcc.a.col[" + std::to_string(j) + "]";
5855  add_name(rebasename, &device[i].mcc.a.col[j], "double");
5856  }
5857  add_name(basename+".motr", &device[i].motr, "motrstruc");
5858  add_name(basename+".motr.max", &device[i].motr.max, "float");
5859  add_name(basename+".motr.rat", &device[i].motr.rat, "float");
5860  add_name(basename+".motr.spd", &device[i].motr.spd, "float");
5861  add_name(basename+".mtr", &device[i].mtr, "mtrstruc");
5862  add_name(basename+".mtr.align", &device[i].mtr.align, "quaternion");
5863  add_name(basename+".mtr.align.d", &device[i].mtr.align.d, "cvector");
5864  add_name(basename+".mtr.align.d.x", &device[i].mtr.align.d.x, "double");
5865  add_name(basename+".mtr.align.d.y", &device[i].mtr.align.d.y, "double");
5866  add_name(basename+".mtr.align.d.z", &device[i].mtr.align.d.z, "double");
5867  add_name(basename+".mtr.align.w", &device[i].mtr.align.w, "double");
5868  add_name(basename+".mtr.npoly", &device[i].mtr.npoly, "float[]");
5869  for(size_t j = 0; j < sizeof(device[i].mtr.npoly)/sizeof(device[i].mtr.npoly[0]); ++j) {
5870  string rebasename = basename + "mtr.npoly[" + std::to_string(j) + "]";
5871  add_name(rebasename, &device[i].mtr.npoly[j], "float");
5872  }
5873  add_name(basename+".mtr.ppoly", &device[i].mtr.ppoly, "float[]");
5874  for(size_t j = 0; j < sizeof(device[i].mtr.ppoly)/sizeof(device[i].mtr.ppoly[0]); ++j) {
5875  string rebasename = basename + "mtr.ppoly[" + std::to_string(j) + "]";
5876  add_name(rebasename, &device[i].mtr.ppoly[j], "float");
5877  }
5878  add_name(basename+".mtr.mxmom", &device[i].mtr.mxmom, "float");
5879  add_name(basename+".mtr.tc", &device[i].mtr.tc, "float");
5880  add_name(basename+".mtr.rmom", &device[i].mtr.rmom, "float");
5881  add_name(basename+".mtr.mom", &device[i].mtr.mom, "float");
5882  add_name(basename+".pload", &device[i].pload, "ploadstruc");
5883  add_name(basename+".pload.key_cnt", &device[i].pload.key_cnt, "uint16_t");
5884  add_name(basename+".pload.keyidx", &device[i].pload.keyidx, "uint16_t[]");
5885  for(size_t j = 0; j < sizeof(device[i].pload.keyidx)/sizeof(device[i].pload.keyidx[0]); ++j) {
5886  string rebasename = basename + "pload.keyidx[" + std::to_string(j) + "]";
5887  add_name(rebasename, &device[i].pload.keyidx[j], "uint16_t");
5888  }
5889  add_name(basename+".pload.keyval", &device[i].pload.keyval, "float[]");
5890  for(size_t j = 0; j < sizeof(device[i].pload.keyval)/sizeof(device[i].pload.keyval[0]); ++j) {
5891  string rebasename = basename + "pload.keyval[" + std::to_string(j) + "]";
5892  add_name(rebasename, &device[i].pload.keyval[j], "float");
5893  }
5894  add_name(basename+".prop", &device[i].prop, "propstruc");
5895  add_name(basename+".prop.cap", &device[i].prop.cap, "float");
5896  add_name(basename+".prop.lev", &device[i].prop.lev, "float");
5897  add_name(basename+".psen", &device[i].psen, "psenstruc");
5898  add_name(basename+".psen.press", &device[i].psen.press, "float");
5899  add_name(basename+".pvstrg", &device[i].pvstrg, "pvstrgstruc");
5900  add_name(basename+".pvstrg.bcidx", &device[i].pvstrg.bcidx, "uint16_t");
5901  add_name(basename+".pvstrg.effbase", &device[i].pvstrg.effbase, "float");
5902  add_name(basename+".pvstrg.effslope", &device[i].pvstrg.effslope, "float");
5903  add_name(basename+".pvstrg.maxpower", &device[i].pvstrg.maxpower, "float");
5904  add_name(basename+".pvstrg.power", &device[i].pvstrg.power, "float");
5905  add_name(basename+".rot", &device[i].rot, "rotstruc");
5906  add_name(basename+".rot.angle", &device[i].rot.angle, "float");
5907  add_name(basename+".rw", &device[i].rw, "rwstruc");
5908  add_name(basename+".rw.align", &device[i].rw.align, "quaternion");
5909  add_name(basename+".rw.align.d", &device[i].rw.align.d, "cvector");
5910  add_name(basename+".rw.align.d.x", &device[i].rw.align.d.x, "double");
5911  add_name(basename+".rw.align.d.y", &device[i].rw.align.d.y, "double");
5912  add_name(basename+".rw.align.d.z", &device[i].rw.align.d.z, "double");
5913  add_name(basename+".rw.align.w", &device[i].rw.align.w, "double");
5914  add_name(basename+".rw.mom", &device[i].rw.mom, "rvector");
5915  add_name(basename+".rw.mom.col", &device[i].rw.mom.col, "double[]");
5916  for(size_t j = 0; j < sizeof(device[i].rw.mom.col)/sizeof(device[i].rw.mom.col[0]); ++j) {
5917  string rebasename = basename + "rw.mom.col[" + std::to_string(j) + "]";
5918  add_name(rebasename, &device[i].rw.mom.col[j], "double");
5919  }
5920  add_name(basename+".rw.mxomg", &device[i].rw.mxomg, "float");
5921  add_name(basename+".rw.mxalp", &device[i].rw.mxalp, "float");
5922  add_name(basename+".rw.tc", &device[i].rw.tc, "float");
5923  add_name(basename+".rw.omg", &device[i].rw.omg, "float");
5924  add_name(basename+".rw.alp", &device[i].rw.alp, "float");
5925  add_name(basename+".rw.romg", &device[i].rw.romg, "float");
5926  add_name(basename+".rw.ralp", &device[i].rw.ralp, "float");
5927  add_name(basename+".rxr", &device[i].rxr, "rxrstruc");
5928  add_name(basename+".rxr.opmode", &device[i].rxr.opmode, "uint16_t");
5929  add_name(basename+".rxr.modulation", &device[i].rxr.modulation, "uint16_t");
5930  add_name(basename+".rxr.rssi", &device[i].rxr.rssi, "uint16_t");
5931  add_name(basename+".rxr.pktsize", &device[i].rxr.pktsize, "uint16_t");
5932  add_name(basename+".rxr.freq", &device[i].rxr.freq, "double");
5933  add_name(basename+".rxr.maxfreq", &device[i].rxr.maxfreq, "double");
5934  add_name(basename+".rxr.minfreq", &device[i].rxr.minfreq, "double");
5935  add_name(basename+".rxr.powerin", &device[i].rxr.powerin, "float");
5936  add_name(basename+".rxr.powerout", &device[i].rxr.powerout, "float");
5937  add_name(basename+".rxr.maxpower", &device[i].rxr.maxpower, "float");
5938  add_name(basename+".rxr.band", &device[i].rxr.band, "float");
5939  add_name(basename+".rxr.squelch_tone", &device[i].rxr.squelch_tone, "float");
5940  add_name(basename+".rxr.goodratio", &device[i].rxr.goodratio, "double");
5941  add_name(basename+".rxr.rxutc", &device[i].rxr.rxutc, "double");
5942  add_name(basename+".rxr.uptime", &device[i].rxr.uptime, "double");
5943  add_name(basename+".ssen", &device[i].ssen, "ssenstruc");
5944  add_name(basename+".ssen.align", &device[i].ssen.align, "quaternion");
5945  add_name(basename+".ssen.align.d", &device[i].ssen.align.d, "cvector");
5946  add_name(basename+".ssen.align.d.x", &device[i].ssen.align.d.x, "double");
5947  add_name(basename+".ssen.align.d.y", &device[i].ssen.align.d.y, "double");
5948  add_name(basename+".ssen.align.d.z", &device[i].ssen.align.d.z, "double");
5949  add_name(basename+".ssen.align.w", &device[i].ssen.align.w, "double");
5950  add_name(basename+".ssen.qva", &device[i].ssen.qva, "float");
5951  add_name(basename+".ssen.qvb", &device[i].ssen.qvb, "float");
5952  add_name(basename+".ssen.qvc", &device[i].ssen.qvc, "float");
5953  add_name(basename+".ssen.qvd", &device[i].ssen.qvd, "float");
5954  add_name(basename+".ssen.azimuth", &device[i].ssen.azimuth, "float");
5955  add_name(basename+".ssen.elevation", &device[i].ssen.elevation, "float");
5956  add_name(basename+".stt", &device[i].stt, "sttstruc");
5957  add_name(basename+".stt.align", &device[i].stt.align, "quaternion");
5958  add_name(basename+".stt.align.d", &device[i].stt.align.d, "cvector");
5959  add_name(basename+".stt.align.d.x", &device[i].stt.align.d.x, "double");
5960  add_name(basename+".stt.align.d.y", &device[i].stt.align.d.y, "double");
5961  add_name(basename+".stt.align.d.z", &device[i].stt.align.d.z, "double");
5962  add_name(basename+".stt.align.w", &device[i].stt.align.w, "double");
5963  add_name(basename+".stt.att", &device[i].stt.att, "quaternion");
5964  add_name(basename+".stt.att.d", &device[i].stt.att.d, "cvector");
5965  add_name(basename+".stt.att.d.x", &device[i].stt.att.d.x, "double");
5966  add_name(basename+".stt.att.d.y", &device[i].stt.att.d.y, "double");
5967  add_name(basename+".stt.att.d.z", &device[i].stt.att.d.z, "double");
5968  add_name(basename+".stt.att.w", &device[i].stt.att.w, "double");
5969  add_name(basename+".stt.omega", &device[i].stt.omega, "rvector");
5970  add_name(basename+".stt.omega.col", &device[i].stt.omega.col, "double[]");
5971  for(size_t j = 0; j < sizeof(device[i].stt.omega.col)/sizeof(device[i].stt.omega.col[0]); ++j) {
5972  string rebasename = basename + "stt.omega.col[" + std::to_string(j) + "]";
5973  add_name(rebasename, &device[i].stt.omega.col[j], "double");
5974  }
5975  add_name(basename+".stt.alpha", &device[i].stt.alpha, "rvector");
5976  add_name(basename+".stt.alpha.col", &device[i].stt.alpha.col, "double[]");
5977  for(size_t j = 0; j < sizeof(device[i].stt.alpha.col)/sizeof(device[i].stt.alpha.col[0]); ++j) {
5978  string rebasename = basename + "stt.alpha.col[" + std::to_string(j) + "]";
5979  add_name(rebasename, &device[i].stt.alpha.col[j], "double");
5980  }
5981  add_name(basename+".stt.retcode", &device[i].stt.retcode, "uint16_t");
5982  add_name(basename+".stt.status", &device[i].stt.status, "uint32_t");
5983  add_name(basename+".suchi", &device[i].suchi, "suchistruc");
5984  add_name(basename+".suchi.align", &device[i].suchi.align, "quaternion");
5985  add_name(basename+".suchi.align.d", &device[i].suchi.align.d, "cvector");
5986  add_name(basename+".suchi.align.d.x", &device[i].suchi.align.d.x, "double");
5987  add_name(basename+".suchi.align.d.y", &device[i].suchi.align.d.y, "double");
5988  add_name(basename+".suchi.align.d.z", &device[i].suchi.align.d.z, "double");
5989  add_name(basename+".suchi.align.w", &device[i].suchi.align.w, "double");
5990  add_name(basename+".suchi.press", &device[i].suchi.press, "float");
5991  add_name(basename+".suchi.temps", &device[i].suchi.temps, "float[]");
5992  for(size_t j = 0; j < sizeof(device[i].suchi.temps)/sizeof(device[i].suchi.temps[0]); ++j) {
5993  string rebasename = basename + "suchi.temps[" + std::to_string(j) + "]";
5994  add_name(rebasename, &device[i].suchi.temps[j], "float");
5995  }
5996  add_name(basename+".swch", &device[i].swch, "swchstruc");
5997  add_name(basename+".tcu", &device[i].tcu, "tcustruc");
5998  add_name(basename+".tcu.mcnt", &device[i].tcu.mcnt, "uint16_t");
5999  add_name(basename+".tcu.mcidx", &device[i].tcu.mcidx, "uint16_t[]");
6000  for(size_t j = 0; j < sizeof(device[i].tcu.mcidx)/sizeof(device[i].tcu.mcidx[0]); ++j) {
6001  string rebasename = basename + "tcu.mcidx[" + std::to_string(j) + "]";
6002  add_name(rebasename, &device[i].tcu.mcidx[j], "uint16_t");
6003  }
6004  add_name(basename+".tcv", &device[i].tcv, "tcvstruc");
6005  add_name(basename+".tcv.opmode", &device[i].tcv.opmode, "uint16_t");
6006  add_name(basename+".tcv.modulation", &device[i].tcv.modulation, "uint16_t");
6007  add_name(basename+".tcv.rssi", &device[i].tcv.rssi, "uint16_t");
6008  add_name(basename+".tcv.pktsize", &device[i].tcv.pktsize, "uint16_t");
6009  add_name(basename+".tcv.freq", &device[i].tcv.freq, "double");
6010  add_name(basename+".tcv.maxfreq", &device[i].tcv.maxfreq, "double");
6011  add_name(basename+".tcv.minfreq", &device[i].tcv.minfreq, "double");
6012  add_name(basename+".tcv.powerin", &device[i].tcv.powerin, "float");
6013  add_name(basename+".tcv.powerout", &device[i].tcv.powerout, "float");
6014  add_name(basename+".tcv.maxpower", &device[i].tcv.maxpower, "float");
6015  add_name(basename+".tcv.band", &device[i].tcv.band, "float");
6016  add_name(basename+".tcv.squelch_tone", &device[i].tcv.squelch_tone, "float");
6017  add_name(basename+".tcv.goodratio", &device[i].tcv.goodratio, "double");
6018  add_name(basename+".tcv.txutc", &device[i].tcv.txutc, "double");
6019  add_name(basename+".tcv.rxutc", &device[i].tcv.rxutc, "double");
6020  add_name(basename+".tcv.uptime", &device[i].tcv.uptime, "double");
6021  add_name(basename+".telem", &device[i].telem, "telemstruc");
6022  add_name(basename+".telem.vuint8", &device[i].telem.vuint8, "uint8_t");
6023  add_name(basename+".telem.vint8", &device[i].telem.vint8, "int8_t");
6024  add_name(basename+".telem.vuint16", &device[i].telem.vuint16, "uint16_t");
6025  add_name(basename+".telem.vint16", &device[i].telem.vint16, "int16_t");
6026  add_name(basename+".telem.vuint32", &device[i].telem.vuint32, "uint32_t");
6027  add_name(basename+".telem.vint32", &device[i].telem.vint32, "int32_t");
6028  add_name(basename+".telem.vfloat", &device[i].telem.vfloat, "float");
6029  add_name(basename+".telem.vdouble", &device[i].telem.vdouble, "double");
6030  add_name(basename+".telem.vstring", &device[i].telem.vstring, "char[]");
6031  add_name(basename+".thst", &device[i].thst, "thststruc");
6032  add_name(basename+".thst.align", &device[i].thst.align, "quaternion");
6033  add_name(basename+".thst.align.d", &device[i].thst.align.d, "cvector");
6034  add_name(basename+".thst.align.d.x", &device[i].thst.align.d.x, "double");
6035  add_name(basename+".thst.align.d.y", &device[i].thst.align.d.y, "double");
6036  add_name(basename+".thst.align.d.z", &device[i].thst.align.d.z, "double");
6037  add_name(basename+".thst.align.w", &device[i].thst.align.w, "double");
6038  add_name(basename+".thst.flw", &device[i].thst.flw, "float");
6039  add_name(basename+".thst.isp", &device[i].thst.isp, "float");
6040  add_name(basename+".tnc", &device[i].tnc, "tncstruc");
6041  add_name(basename+".tsen", &device[i].tsen, "tsenstruc");
6042  add_name(basename+".txr", &device[i].txr, "txrstruc");
6043  add_name(basename+".txr.opmode", &device[i].txr.opmode, "uint16_t");
6044  add_name(basename+".txr.modulation", &device[i].txr.modulation, "uint16_t");
6045  add_name(basename+".txr.rssi", &device[i].txr.rssi, "uint16_t");
6046  add_name(basename+".txr.pktsize", &device[i].txr.pktsize, "uint16_t");
6047  add_name(basename+".txr.freq", &device[i].txr.freq, "double");
6048  add_name(basename+".txr.maxfreq", &device[i].txr.maxfreq, "double");
6049  add_name(basename+".txr.minfreq", &device[i].txr.minfreq, "double");
6050  add_name(basename+".txr.powerin", &device[i].txr.powerin, "float");
6051  add_name(basename+".txr.powerout", &device[i].txr.powerout, "float");
6052  add_name(basename+".txr.maxpower", &device[i].txr.maxpower, "float");
6053  add_name(basename+".txr.band", &device[i].txr.band, "float");
6054  add_name(basename+".txr.squelch_tone", &device[i].txr.squelch_tone, "float");
6055  add_name(basename+".txr.goodratio", &device[i].txr.goodratio, "double");
6056  add_name(basename+".txr.txutc", &device[i].txr.txutc, "double");
6057  add_name(basename+".txr.uptime", &device[i].txr.uptime, "double");
6058  }
6059 
6060 
6061  // devspecstruc devspec
6062  add_name("devspec", &devspec, "devspecstruc");
6063  add_name("devspec.all_cnt", &devspec.all_cnt, "uint16_t");
6064  add_name("devspec.ant_cnt", &devspec.ant_cnt, "uint16_t");
6065  add_name("devspec.batt_cnt", &devspec.batt_cnt, "uint16_t");
6066  add_name("devspec.bus_cnt", &devspec.bus_cnt, "uint16_t");
6067  add_name("devspec.cam_cnt", &devspec.cam_cnt, "uint16_t");
6068  add_name("devspec.cpu_cnt", &devspec.cpu_cnt, "uint16_t");
6069  add_name("devspec.disk_cnt", &devspec.disk_cnt, "uint16_t");
6070  add_name("devspec.gps_cnt", &devspec.gps_cnt, "uint16_t");
6071  add_name("devspec.htr_cnt", &devspec.htr_cnt, "uint16_t");
6072  add_name("devspec.imu_cnt", &devspec.imu_cnt, "uint16_t");
6073  add_name("devspec.mcc_cnt", &devspec.mcc_cnt, "uint16_t");
6074  add_name("devspec.motr_cnt", &devspec.motr_cnt, "uint16_t");
6075  add_name("devspec.mtr_cnt", &devspec.mtr_cnt, "uint16_t");
6076  add_name("devspec.pload_cnt", &devspec.pload_cnt, "uint16_t");
6077  add_name("devspec.prop_cnt", &devspec.prop_cnt, "uint16_t");
6078  add_name("devspec.psen_cnt", &devspec.psen_cnt, "uint16_t");
6079  add_name("devspec.bcreg_cnt", &devspec.bcreg_cnt, "uint16_t");
6080  add_name("devspec.rot_cnt", &devspec.rot_cnt, "uint16_t");
6081  add_name("devspec.rw_cnt", &devspec.rw_cnt, "uint16_t");
6082  add_name("devspec.rxr_cnt", &devspec.rxr_cnt, "uint16_t");
6083  add_name("devspec.ssen_cnt", &devspec.ssen_cnt, "uint16_t");
6084  add_name("devspec.pvstrg_cnt", &devspec.pvstrg_cnt, "uint16_t");
6085  add_name("devspec.stt_cnt", &devspec.stt_cnt, "uint16_t");
6086  add_name("devspec.suchi_cnt", &devspec.suchi_cnt, "uint16_t");
6087  add_name("devspec.swch_cnt", &devspec.swch_cnt, "uint16_t");
6088  add_name("devspec.tcu_cnt", &devspec.tcu_cnt, "uint16_t");
6089  add_name("devspec.tcv_cnt", &devspec.tcv_cnt, "uint16_t");
6090  add_name("devspec.telem_cnt", &devspec.telem_cnt, "uint16_t");
6091  add_name("devspec.thst_cnt", &devspec.thst_cnt, "uint16_t");
6092  add_name("devspec.tsen_cnt", &devspec.tsen_cnt, "uint16_t");
6093  add_name("devspec.tnc_cnt", &devspec.tnc_cnt, "uint16_t");
6094  add_name("devspec.txr_cnt", &devspec.txr_cnt, "uint16_t");
6095 
6096 
6097  // vector<portstruc> port
6098  add_name("port", &port, "vector<portstruc>");
6099  for(size_t i = 0; i < port.capacity(); ++i) {
6100  string basename = "port[" + std::to_string(i) + "]";
6101  add_name(basename, &port[i], "portstruc");
6102  add_name(basename+".type", &port[i].type, "PORT_TYPE");
6103  add_name(basename+".name", &port[i].name, "char[]");
6104  }
6105 
6106  // vector<agentstruc> agent
6107  add_name("agent", &agent, "vector<agentstruc>");
6108  for(size_t i = 0; i < agent.capacity(); ++i) {
6109  string basename = "agent[" + std::to_string(i) + "]";
6110  add_name(basename, &agent[i], "agentstruc");
6111  add_name(basename+".client", &agent[i].client, "bool");
6112  add_name(basename+".sub", &agent[i].sub, "socket_channel");
6113  add_name(basename+".sub.type", &agent[i].sub.type, "NetworkType");
6114  add_name(basename+".sub.cudp", &agent[i].sub.cudp, "int32_t");
6115  add_name(basename+".server", &agent[i].server, "bool");
6116  add_name(basename+".ifcnt", &agent[i].ifcnt, "size_t");
6117  add_name(basename+".pub", &agent[i].pub, "socket_channel[]");
6118  for(size_t j = 0; j < sizeof(agent[i].pub)/sizeof(agent[i].pub[0]); ++j) {
6119  string rebasename = basename + ".pub[" + std::to_string(j) + "]";
6120  add_name(rebasename, &agent[i].pub[j], "socket_channel");
6121  add_name(rebasename+".type", &agent[i].pub[j].type, "NetworkType");
6122  add_name(rebasename+".cudp", &agent[i].pub[j].cudp, "int32_t");
6123  }
6124  add_name(basename+".req", &agent[i].req, "socket_channel");
6125  add_name(basename+".req.type", &agent[i].req.type, "NetworkType");
6126  add_name(basename+".req.cudp", &agent[i].req.cudp, "int32_t");
6127  add_name(basename+".pid", &agent[i].pid, "int32_t");
6128  add_name(basename+".aprd", &agent[i].aprd, "double");
6129  add_name(basename+".stateflag", &agent[i].stateflag, "uint16_t");
6130  add_name(basename+".reqs", &agent[i].reqs, "vector<agent_request_entry>");
6131  for(size_t j = 0; j < agent[i].reqs.capacity(); ++j) {
6132  string rebasename = basename + ".reqs[" + std::to_string(j) + "]";
6133  add_name(rebasename, &agent[i].reqs[j], "agent_request_entry");
6134  add_name(rebasename+".token", &agent[i].reqs[j].token, "string");
6135  add_name(rebasename+".function", &agent[i].reqs[j].function, "agent_request_function");
6136  add_name(rebasename+".synopsis", &agent[i].reqs[j].synopsis, "string");
6137  add_name(rebasename+".description", &agent[i].reqs[j].description, "string");
6138  }
6139  add_name(basename+".beat", &agent[i].beat, "beatstruc");
6140  add_name(basename+".beat.utc", &agent[i].beat.utc, "double");
6141  add_name(basename+".beat.node", &agent[i].beat.node, "char[]");
6142  add_name(basename+".beat.proc", &agent[i].beat.proc, "char[]");
6143  add_name(basename+".beat.ntype", &agent[i].beat.ntype, "NetworkType");
6144  add_name(basename+".beat.addr", &agent[i].beat.addr, "char[]");
6145  add_name(basename+".beat.port", &agent[i].beat.port, "uint16_t");
6146  add_name(basename+".beat.bsz", &agent[i].beat.bsz, "uint32_t");
6147  add_name(basename+".beat.bprd", &agent[i].beat.bprd, "double");
6148  add_name(basename+".beat.user", &agent[i].beat.user, "char[]");
6149  add_name(basename+".beat.cpu", &agent[i].beat.cpu, "float");
6150  add_name(basename+".beat.memory", &agent[i].beat.memory, "float");
6151  add_name(basename+".beat.jitter", &agent[i].beat.jitter, "double");
6152  add_name(basename+".beat.exists", &agent[i].beat.exists, "bool");
6153  }
6154 
6155  // vector<eventstruc> event
6156  add_name("event", &event, "vector<eventstruc>");
6157  for(size_t i = 0; i < event.capacity(); ++i) {
6158  string basename = "event[" + std::to_string(i) + "]";
6159  add_name(basename, &event[i], "eventstruc");
6160  add_name(basename+".utc", &event[i].utc, "double");
6161  add_name(basename+".utcexec", &event[i].utcexec, "double");
6162  add_name(basename+".node", &event[i].node, "char[]");
6163  add_name(basename+".name", &event[i].name, "char[]");
6164  add_name(basename+".user", &event[i].user, "char[]");
6165  add_name(basename+".flag", &event[i].flag, "uint32_t");
6166  add_name(basename+".type", &event[i].type, "uint32_t");
6167  add_name(basename+".value", &event[i].value, "double");
6168  add_name(basename+".dtime", &event[i].dtime, "double");
6169  add_name(basename+".ctime", &event[i].ctime, "double");
6170  add_name(basename+".denergy", &event[i].denergy, "float");
6171  add_name(basename+".cenergy", &event[i].cenergy, "float");
6172  add_name(basename+".dmass", &event[i].dmass, "float");
6173  add_name(basename+".cmass", &event[i].cmass, "float");
6174  add_name(basename+".dbytes", &event[i].dbytes, "float");
6175  add_name(basename+".cbytes", &event[i].cbytes, "float");
6176  add_name(basename+".handle", &event[i].handle, "jsonhandle");
6177  add_name(basename+".handle.hash", &event[i].handle.hash, "uint16_t");
6178  add_name(basename+".handle.index", &event[i].handle.index, "uint16_t");
6179  add_name(basename+".data", &event[i].data, "char[]");
6180  add_name(basename+".condition", &event[i].condition, "char[]");
6181  }
6182 
6183 
6184  // vector<targetstruc> target
6185  add_name("target", &target, "vector<targetstruc>");
6186  for(size_t i = 0; i < target.capacity(); ++i) {
6187  string basename = "target[" + std::to_string(i) + "]";
6188  add_name(basename, &target[i], "targetstruc");
6189  add_name(basename+".utc", &target[i].utc, "double");
6190  add_name(basename+".name", &target[i].name, "char[]");
6191  add_name(basename+".type", &target[i].type, "uint16_t");
6192  add_name(basename+".azfrom", &target[i].azfrom, "float");
6193  add_name(basename+".elfrom", &target[i].elfrom, "float");
6194  add_name(basename+".azto", &target[i].azto, "float");
6195  add_name(basename+".elto", &target[i].elto, "float");
6196  add_name(basename+".range", &target[i].range, "double");
6197  add_name(basename+".close", &target[i].close, "double");
6198  add_name(basename+".min", &target[i].min, "float");
6199  add_name(basename+".loc", &target[i].loc, "locstruc");
6200  add_name(basename+".loc.utc", &target[i].loc.utc, "double");
6201  add_name(basename+".loc.pos", &target[i].loc.pos, "posstruc");
6202  add_name(basename+".loc.pos.utc", &target[i].loc.pos.utc, "double");
6203  add_name(basename+".loc.pos.icrf", &target[i].loc.pos.icrf, "cartpos");
6204  add_name(basename+".loc.pos.icrf.utc", &target[i].loc.pos.icrf.utc, "double");
6205  add_name(basename+".loc.pos.icrf.s", &target[i].loc.pos.icrf.s, "rvector");
6206  add_name(basename+".loc.pos.icrf.s.col", &target[i].loc.pos.icrf.s.col, "double[]");
6207  for(size_t j = 0; j < sizeof(target[i].loc.pos.icrf.s.col)/sizeof(target[i].loc.pos.icrf.s.col[0]); ++j) {
6208  string rebasename = basename + "loc.pos.icrf.s.col[" + std::to_string(j) + "]";
6209  add_name(rebasename, &target[i].loc.pos.icrf.s.col[j], "double");
6210  }
6211  add_name(basename+".loc.pos.icrf.v", &target[i].loc.pos.icrf.v, "rvector");
6212  add_name(basename+".loc.pos.icrf.v.col", &target[i].loc.pos.icrf.v.col, "double[]");
6213  for(size_t j = 0; j < sizeof(target[i].loc.pos.icrf.v.col)/sizeof(target[i].loc.pos.icrf.v.col[0]); ++j) {
6214  string rebasename = basename + "loc.pos.icrf.v.col[" + std::to_string(j) + "]";
6215  add_name(rebasename, &target[i].loc.pos.icrf.v.col[j], "double");
6216  }
6217  add_name(basename+".loc.pos.icrf.a", &target[i].loc.pos.icrf.a, "rvector");
6218  add_name(basename+".loc.pos.icrf.a.col", &target[i].loc.pos.icrf.a.col, "double[]");
6219  for(size_t j = 0; j < sizeof(target[i].loc.pos.icrf.a.col)/sizeof(target[i].loc.pos.icrf.a.col[0]); ++j) {
6220  string rebasename = basename + "loc.pos.icrf.a.col[" + std::to_string(j) + "]";
6221  add_name(rebasename, &target[i].loc.pos.icrf.a.col[j], "double");
6222  }
6223  add_name(basename+".loc.pos.icrf.pass", &target[i].loc.pos.icrf.pass, "uint32_t");
6224  add_name(basename+".loc.pos.eci", &target[i].loc.pos.eci, "cartpos");
6225  add_name(basename+".loc.pos.eci.utc", &target[i].loc.pos.eci.utc, "double");
6226  add_name(basename+".loc.pos.eci.s", &target[i].loc.pos.eci.s, "rvector");
6227  add_name(basename+".loc.pos.eci.s.col", &target[i].loc.pos.eci.s.col, "double[]");
6228  for(size_t j = 0; j < sizeof(target[i].loc.pos.eci.s.col)/sizeof(target[i].loc.pos.eci.s.col[0]); ++j) {
6229  string rebasename = basename + "loc.pos.eci.s.col[" + std::to_string(j) + "]";
6230  add_name(rebasename, &target[i].loc.pos.eci.s.col[j], "double");
6231  }
6232  add_name(basename+".loc.pos.eci.v", &target[i].loc.pos.eci.v, "rvector");
6233  add_name(basename+".loc.pos.eci.v.col", &target[i].loc.pos.eci.v.col, "double[]");
6234  for(size_t j = 0; j < sizeof(target[i].loc.pos.eci.v.col)/sizeof(target[i].loc.pos.eci.v.col[0]); ++j) {
6235  string rebasename = basename + "loc.pos.eci.v.col[" + std::to_string(j) + "]";
6236  add_name(rebasename, &target[i].loc.pos.eci.v.col[j], "double");
6237  }
6238  add_name(basename+".loc.pos.eci.a", &target[i].loc.pos.eci.a, "rvector");
6239  add_name(basename+".loc.pos.eci.a.col", &target[i].loc.pos.eci.a.col, "double[]");
6240  for(size_t j = 0; j < sizeof(target[i].loc.pos.eci.a.col)/sizeof(target[i].loc.pos.eci.a.col[0]); ++j) {
6241  string rebasename = basename + "loc.pos.eci.a.col[" + std::to_string(j) + "]";
6242  add_name(rebasename, &target[i].loc.pos.eci.a.col[j], "double");
6243  }
6244  add_name(basename+".loc.pos.eci.pass", &target[i].loc.pos.eci.pass, "uint32_t");
6245  add_name(basename+".loc.pos.sci", &target[i].loc.pos.sci, "cartpos");
6246  add_name(basename+".loc.pos.sci.utc", &target[i].loc.pos.sci.utc, "double");
6247  add_name(basename+".loc.pos.sci.s", &target[i].loc.pos.sci.s, "rvector");
6248  add_name(basename+".loc.pos.sci.s.col", &target[i].loc.pos.sci.s.col, "double[]");
6249  for(size_t j = 0; j < sizeof(target[i].loc.pos.sci.s.col)/sizeof(target[i].loc.pos.sci.s.col[0]); ++j) {
6250  string rebasename = basename + "loc.pos.sci.s.col[" + std::to_string(j) + "]";
6251  add_name(rebasename, &target[i].loc.pos.sci.s.col[j], "double");
6252  }
6253  add_name(basename+".loc.pos.sci.v", &target[i].loc.pos.sci.v, "rvector");
6254  add_name(basename+".loc.pos.sci.v.col", &target[i].loc.pos.sci.v.col, "double[]");
6255  for(size_t j = 0; j < sizeof(target[i].loc.pos.sci.v.col)/sizeof(target[i].loc.pos.sci.v.col[0]); ++j) {
6256  string rebasename = basename + "loc.pos.sci.v.col[" + std::to_string(j) + "]";
6257  add_name(rebasename, &target[i].loc.pos.sci.v.col[j], "double");
6258  }
6259  add_name(basename+".loc.pos.sci.a", &target[i].loc.pos.sci.a, "rvector");
6260  add_name(basename+".loc.pos.sci.a.col", &target[i].loc.pos.sci.a.col, "double[]");
6261  for(size_t j = 0; j < sizeof(target[i].loc.pos.sci.a.col)/sizeof(target[i].loc.pos.sci.a.col[0]); ++j) {
6262  string rebasename = basename + "loc.pos.sci.a.col[" + std::to_string(j) + "]";
6263  add_name(rebasename, &target[i].loc.pos.sci.a.col[j], "double");
6264  }
6265  add_name(basename+".loc.pos.sci.pass", &target[i].loc.pos.sci.pass, "uint32_t");
6266  add_name(basename+".loc.pos.geoc", &target[i].loc.pos.geoc, "cartpos");
6267  add_name(basename+".loc.pos.geoc.utc", &target[i].loc.pos.geoc.utc, "double");
6268  add_name(basename+".loc.pos.geoc.s", &target[i].loc.pos.geoc.s, "rvector");
6269  add_name(basename+".loc.pos.geoc.s.col", &target[i].loc.pos.geoc.s.col, "double[]");
6270  for(size_t j = 0; j < sizeof(target[i].loc.pos.geoc.s.col)/sizeof(target[i].loc.pos.geoc.s.col[0]); ++j) {
6271  string rebasename = basename + "loc.pos.geoc.s.col[" + std::to_string(j) + "]";
6272  add_name(rebasename, &target[i].loc.pos.geoc.s.col[j], "double");
6273  }
6274  add_name(basename+".loc.pos.geoc.v", &target[i].loc.pos.geoc.v, "rvector");
6275  add_name(basename+".loc.pos.geoc.v.col", &target[i].loc.pos.geoc.v.col, "double[]");
6276  for(size_t j = 0; j < sizeof(target[i].loc.pos.geoc.v.col)/sizeof(target[i].loc.pos.geoc.v.col[0]); ++j) {
6277  string rebasename = basename + "loc.pos.geoc.v.col[" + std::to_string(j) + "]";
6278  add_name(rebasename, &target[i].loc.pos.geoc.v.col[j], "double");
6279  }
6280  add_name(basename+".loc.pos.geoc.a", &target[i].loc.pos.geoc.a, "rvector");
6281  add_name(basename+".loc.pos.geoc.a.col", &target[i].loc.pos.geoc.a.col, "double[]");
6282  for(size_t j = 0; j < sizeof(target[i].loc.pos.geoc.a.col)/sizeof(target[i].loc.pos.geoc.a.col[0]); ++j) {
6283  string rebasename = basename + "loc.pos.geoc.a.col[" + std::to_string(j) + "]";
6284  add_name(rebasename, &target[i].loc.pos.geoc.a.col[j], "double");
6285  }
6286  add_name(basename+".loc.pos.geoc.pass", &target[i].loc.pos.geoc.pass, "uint32_t");
6287  add_name(basename+".loc.pos.selc", &target[i].loc.pos.selc, "cartpos");
6288  add_name(basename+".loc.pos.selc.utc", &target[i].loc.pos.selc.utc, "double");
6289  add_name(basename+".loc.pos.selc.s", &target[i].loc.pos.selc.s, "rvector");
6290  add_name(basename+".loc.pos.selc.s.col", &target[i].loc.pos.selc.s.col, "double[]");
6291  for(size_t j = 0; j < sizeof(target[i].loc.pos.selc.s.col)/sizeof(target[i].loc.pos.selc.s.col[0]); ++j) {
6292  string rebasename = basename + "loc.pos.selc.s.col[" + std::to_string(j) + "]";
6293  add_name(rebasename, &target[i].loc.pos.selc.s.col[j], "double");
6294  }
6295  add_name(basename+".loc.pos.selc.v", &target[i].loc.pos.selc.v, "rvector");
6296  add_name(basename+".loc.pos.selc.v.col", &target[i].loc.pos.selc.v.col, "double[]");
6297  for(size_t j = 0; j < sizeof(target[i].loc.pos.selc.v.col)/sizeof(target[i].loc.pos.selc.v.col[0]); ++j) {
6298  string rebasename = basename + "loc.pos.selc.v.col[" + std::to_string(j) + "]";
6299  add_name(rebasename, &target[i].loc.pos.selc.v.col[j], "double");
6300  }
6301  add_name(basename+".loc.pos.selc.a", &target[i].loc.pos.selc.a, "rvector");
6302  add_name(basename+".loc.pos.selc.a.col", &target[i].loc.pos.selc.a.col, "double[]");
6303  for(size_t j = 0; j < sizeof(target[i].loc.pos.selc.a.col)/sizeof(target[i].loc.pos.selc.a.col[0]); ++j) {
6304  string rebasename = basename + "loc.pos.selc.a.col[" + std::to_string(j) + "]";
6305  add_name(rebasename, &target[i].loc.pos.selc.a.col[j], "double");
6306  }
6307  add_name(basename+".loc.pos.selc.pass", &target[i].loc.pos.selc.pass, "uint32_t");
6308  add_name(basename+".loc.pos.geod", &target[i].loc.pos.geod, "geoidpos");
6309  add_name(basename+".loc.pos.geod.utc", &target[i].loc.pos.geod.utc, "double");
6310  add_name(basename+".loc.pos.geod.s", &target[i].loc.pos.geod.s, "gvector");
6311  add_name(basename+".loc.pos.geod.s.lat", &target[i].loc.pos.geod.s.lat, "double");
6312  add_name(basename+".loc.pos.geod.s.lon", &target[i].loc.pos.geod.s.lon, "double");
6313  add_name(basename+".loc.pos.geod.s.h", &target[i].loc.pos.geod.s.h, "double");
6314  add_name(basename+".loc.pos.geod.v", &target[i].loc.pos.geod.v, "gvector");
6315  add_name(basename+".loc.pos.geod.v.lat", &target[i].loc.pos.geod.v.lat, "double");
6316  add_name(basename+".loc.pos.geod.v.lon", &target[i].loc.pos.geod.v.lon, "double");
6317  add_name(basename+".loc.pos.geod.v.h", &target[i].loc.pos.geod.v.h, "double");
6318  add_name(basename+".loc.pos.geod.a", &target[i].loc.pos.geod.a, "gvector");
6319  add_name(basename+".loc.pos.geod.a.lat", &target[i].loc.pos.geod.a.lat, "double");
6320  add_name(basename+".loc.pos.geod.a.lon", &target[i].loc.pos.geod.a.lon, "double");
6321  add_name(basename+".loc.pos.geod.a.h", &target[i].loc.pos.geod.a.h, "double");
6322  add_name(basename+".loc.pos.geod.pass", &target[i].loc.pos.geod.pass, "uint32_t");
6323  add_name(basename+".loc.pos.selg", &target[i].loc.pos.selg, "geoidpos");
6324  add_name(basename+".loc.pos.selg.utc", &target[i].loc.pos.selg.utc, "double");
6325  add_name(basename+".loc.pos.selg.s", &target[i].loc.pos.selg.s, "gvector");
6326  add_name(basename+".loc.pos.selg.s.lat", &target[i].loc.pos.selg.s.lat, "double");
6327  add_name(basename+".loc.pos.selg.s.lon", &target[i].loc.pos.selg.s.lon, "double");
6328  add_name(basename+".loc.pos.selg.s.h", &target[i].loc.pos.selg.s.h, "double");
6329  add_name(basename+".loc.pos.selg.v", &target[i].loc.pos.selg.v, "gvector");
6330  add_name(basename+".loc.pos.selg.v.lat", &target[i].loc.pos.selg.v.lat, "double");
6331  add_name(basename+".loc.pos.selg.v.lon", &target[i].loc.pos.selg.v.lon, "double");
6332  add_name(basename+".loc.pos.selg.v.h", &target[i].loc.pos.selg.v.h, "double");
6333  add_name(basename+".loc.pos.selg.a", &target[i].loc.pos.selg.a, "gvector");
6334  add_name(basename+".loc.pos.selg.a.lat", &target[i].loc.pos.selg.a.lat, "double");
6335  add_name(basename+".loc.pos.selg.a.lon", &target[i].loc.pos.selg.a.lon, "double");
6336  add_name(basename+".loc.pos.selg.a.h", &target[i].loc.pos.selg.a.h, "double");
6337  add_name(basename+".loc.pos.selg.pass", &target[i].loc.pos.selg.pass, "uint32_t");
6338  add_name(basename+".loc.pos.geos", &target[i].loc.pos.geos, "spherpos");
6339  add_name(basename+".loc.pos.geos.utc", &target[i].loc.pos.geos.utc, "double");
6340  add_name(basename+".loc.pos.geos.s", &target[i].loc.pos.geos.s, "svector");
6341  add_name(basename+".loc.pos.geos.s.phi", &target[i].loc.pos.geos.s.phi, "double");
6342  add_name(basename+".loc.pos.geos.s.lambda", &target[i].loc.pos.geos.s.lambda, "double");
6343  add_name(basename+".loc.pos.geos.s.r", &target[i].loc.pos.geos.s.r, "double");
6344  add_name(basename+".loc.pos.geos.v", &target[i].loc.pos.geos.v, "svector");
6345  add_name(basename+".loc.pos.geos.v.phi", &target[i].loc.pos.geos.v.phi, "double");
6346  add_name(basename+".loc.pos.geos.v.lambda", &target[i].loc.pos.geos.v.lambda, "double");
6347  add_name(basename+".loc.pos.geos.v.r", &target[i].loc.pos.geos.v.r, "double");
6348  add_name(basename+".loc.pos.geos.a", &target[i].loc.pos.geos.a, "svector");
6349  add_name(basename+".loc.pos.geos.a.phi", &target[i].loc.pos.geos.a.phi, "double");
6350  add_name(basename+".loc.pos.geos.a.lambda", &target[i].loc.pos.geos.a.lambda, "double");
6351  add_name(basename+".loc.pos.geos.a.r", &target[i].loc.pos.geos.a.r, "double");
6352  add_name(basename+".loc.pos.geos.pass", &target[i].loc.pos.geos.pass, "uint32_t");
6353  add_name(basename+".loc.pos.extra", &target[i].loc.pos.extra, "extrapos");
6354  add_name(basename+".loc.pos.extra.utc", &target[i].loc.pos.extra.utc, "double");
6355  add_name(basename+".loc.pos.extra.tt", &target[i].loc.pos.extra.tt, "double");
6356  add_name(basename+".loc.pos.extra.ut", &target[i].loc.pos.extra.ut, "double");
6357  add_name(basename+".loc.pos.extra.tdb", &target[i].loc.pos.extra.tdb, "double");
6358  add_name(basename+".loc.pos.extra.j2e", &target[i].loc.pos.extra.j2e, "rmatrix");
6359  add_name(basename+".loc.pos.extra.j2e.row", &target[i].loc.pos.extra.j2e.row, "rvector[]");
6360  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.j2e.row)/sizeof(target[i].loc.pos.extra.j2e.row[0]); ++j) {
6361  string rebasename = basename + "loc.pos.extra.j2e.row[" + std::to_string(j) + "]";
6362  add_name(rebasename, &target[i].loc.pos.extra.j2e.row[j], "rvector");
6363  add_name(rebasename+".col", &target[i].loc.pos.extra.j2e.row[j].col, "double[]");
6364  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.j2e.row[j].col)/sizeof(target[i].loc.pos.extra.j2e.row[j].col[0]); ++k) {
6365  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6366  add_name(rebasename2, &target[i].loc.pos.extra.j2e.row[j].col[k], "double");
6367  }
6368  }
6369  add_name(basename+".loc.pos.extra.dj2e", &target[i].loc.pos.extra.dj2e, "rmatrix");
6370  add_name(basename+".loc.pos.extra.dj2e.row", &target[i].loc.pos.extra.dj2e.row, "rvector[]");
6371  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.dj2e.row)/sizeof(target[i].loc.pos.extra.dj2e.row[0]); ++j) {
6372  string rebasename = basename + "loc.pos.extra.dj2e.row[" + std::to_string(j) + "]";
6373  add_name(rebasename, &target[i].loc.pos.extra.dj2e.row[j], "rvector");
6374  add_name(rebasename+".col", &target[i].loc.pos.extra.dj2e.row[j].col, "double[]");
6375  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.dj2e.row[j].col)/sizeof(target[i].loc.pos.extra.dj2e.row[j].col[0]); ++k) {
6376  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6377  add_name(rebasename2, &target[i].loc.pos.extra.dj2e.row[j].col[k], "double");
6378  }
6379  }
6380  add_name(basename+".loc.pos.extra.ddj2e", &target[i].loc.pos.extra.ddj2e, "rmatrix");
6381  add_name(basename+".loc.pos.extra.ddj2e.row", &target[i].loc.pos.extra.ddj2e.row, "rvector[]");
6382  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.ddj2e.row)/sizeof(target[i].loc.pos.extra.ddj2e.row[0]); ++j) {
6383  string rebasename = basename + "loc.pos.extra.ddj2e.row[" + std::to_string(j) + "]";
6384  add_name(rebasename, &target[i].loc.pos.extra.ddj2e.row[j], "rvector");
6385  add_name(rebasename+".col", &target[i].loc.pos.extra.ddj2e.row[j].col, "double[]");
6386  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.ddj2e.row[j].col)/sizeof(target[i].loc.pos.extra.ddj2e.row[j].col[0]); ++k) {
6387  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6388  add_name(rebasename2, &target[i].loc.pos.extra.ddj2e.row[j].col[k], "double");
6389  }
6390  }
6391  add_name(basename+".loc.pos.extra.e2j", &target[i].loc.pos.extra.e2j, "rmatrix");
6392  add_name(basename+".loc.pos.extra.e2j.row", &target[i].loc.pos.extra.e2j.row, "rvector[]");
6393  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.e2j.row)/sizeof(target[i].loc.pos.extra.e2j.row[0]); ++j) {
6394  string rebasename = basename + "loc.pos.extra.e2j.row[" + std::to_string(j) + "]";
6395  add_name(rebasename, &target[i].loc.pos.extra.e2j.row[j], "rvector");
6396  add_name(rebasename+".col", &target[i].loc.pos.extra.e2j.row[j].col, "double[]");
6397  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.e2j.row[j].col)/sizeof(target[i].loc.pos.extra.e2j.row[j].col[0]); ++k) {
6398  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6399  add_name(rebasename2, &target[i].loc.pos.extra.e2j.row[j].col[k], "double");
6400  }
6401  }
6402  add_name(basename+".loc.pos.extra.de2j", &target[i].loc.pos.extra.de2j, "rmatrix");
6403  add_name(basename+".loc.pos.extra.de2j.row", &target[i].loc.pos.extra.de2j.row, "rvector[]");
6404  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.de2j.row)/sizeof(target[i].loc.pos.extra.de2j.row[0]); ++j) {
6405  string rebasename = basename + "loc.pos.extra.de2j.row[" + std::to_string(j) + "]";
6406  add_name(rebasename, &target[i].loc.pos.extra.de2j.row[j], "rvector");
6407  add_name(rebasename+".col", &target[i].loc.pos.extra.de2j.row[j].col, "double[]");
6408  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.de2j.row[j].col)/sizeof(target[i].loc.pos.extra.de2j.row[j].col[0]); ++k) {
6409  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6410  add_name(rebasename2, &target[i].loc.pos.extra.de2j.row[j].col[k], "double");
6411  }
6412  }
6413  add_name(basename+".loc.pos.extra.dde2j", &target[i].loc.pos.extra.dde2j, "rmatrix");
6414  add_name(basename+".loc.pos.extra.dde2j.row", &target[i].loc.pos.extra.dde2j.row, "rvector[]");
6415  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.dde2j.row)/sizeof(target[i].loc.pos.extra.dde2j.row[0]); ++j) {
6416  string rebasename = basename + "loc.pos.extra.dde2j.row[" + std::to_string(j) + "]";
6417  add_name(rebasename, &target[i].loc.pos.extra.dde2j.row[j], "rvector");
6418  add_name(rebasename+".col", &target[i].loc.pos.extra.dde2j.row[j].col, "double[]");
6419  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.dde2j.row[j].col)/sizeof(target[i].loc.pos.extra.dde2j.row[j].col[0]); ++k) {
6420  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6421  add_name(rebasename2, &target[i].loc.pos.extra.dde2j.row[j].col[k], "double");
6422  }
6423  }
6424  add_name(basename+".loc.pos.extra.j2t", &target[i].loc.pos.extra.j2t, "rmatrix");
6425  add_name(basename+".loc.pos.extra.j2t.row", &target[i].loc.pos.extra.j2t.row, "rvector[]");
6426  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.j2t.row)/sizeof(target[i].loc.pos.extra.j2t.row[0]); ++j) {
6427  string rebasename = basename + "loc.pos.extra.j2t.row[" + std::to_string(j) + "]";
6428  add_name(rebasename, &target[i].loc.pos.extra.j2t.row[j], "rvector");
6429  add_name(rebasename+".col", &target[i].loc.pos.extra.j2t.row[j].col, "double[]");
6430  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.j2t.row[j].col)/sizeof(target[i].loc.pos.extra.j2t.row[j].col[0]); ++k) {
6431  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6432  add_name(rebasename2, &target[i].loc.pos.extra.j2t.row[j].col[k], "double");
6433  }
6434  }
6435  add_name(basename+".loc.pos.extra.j2s", &target[i].loc.pos.extra.j2s, "rmatrix");
6436  add_name(basename+".loc.pos.extra.j2s.row", &target[i].loc.pos.extra.j2s.row, "rvector[]");
6437  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.j2s.row)/sizeof(target[i].loc.pos.extra.j2s.row[0]); ++j) {
6438  string rebasename = basename + "loc.pos.extra.j2s.row[" + std::to_string(j) + "]";
6439  add_name(rebasename, &target[i].loc.pos.extra.j2s.row[j], "rvector");
6440  add_name(rebasename+".col", &target[i].loc.pos.extra.j2s.row[j].col, "double[]");
6441  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.j2s.row[j].col)/sizeof(target[i].loc.pos.extra.j2s.row[j].col[0]); ++k) {
6442  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6443  add_name(rebasename2, &target[i].loc.pos.extra.j2s.row[j].col[k], "double");
6444  }
6445  }
6446  add_name(basename+".loc.pos.extra.t2j", &target[i].loc.pos.extra.t2j, "rmatrix");
6447  add_name(basename+".loc.pos.extra.t2j.row", &target[i].loc.pos.extra.t2j.row, "rvector[]");
6448  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.t2j.row)/sizeof(target[i].loc.pos.extra.t2j.row[0]); ++j) {
6449  string rebasename = basename + "loc.pos.extra.t2j.row[" + std::to_string(j) + "]";
6450  add_name(rebasename, &target[i].loc.pos.extra.t2j.row[j], "rvector");
6451  add_name(rebasename+".col", &target[i].loc.pos.extra.t2j.row[j].col, "double[]");
6452  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.t2j.row[j].col)/sizeof(target[i].loc.pos.extra.t2j.row[j].col[0]); ++k) {
6453  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6454  add_name(rebasename2, &target[i].loc.pos.extra.t2j.row[j].col[k], "double");
6455  }
6456  }
6457  add_name(basename+".loc.pos.extra.s2j", &target[i].loc.pos.extra.s2j, "rmatrix");
6458  add_name(basename+".loc.pos.extra.s2j.row", &target[i].loc.pos.extra.s2j.row, "rvector[]");
6459  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.s2j.row)/sizeof(target[i].loc.pos.extra.s2j.row[0]); ++j) {
6460  string rebasename = basename + "loc.pos.extra.s2j.row[" + std::to_string(j) + "]";
6461  add_name(rebasename, &target[i].loc.pos.extra.s2j.row[j], "rvector");
6462  add_name(rebasename+".col", &target[i].loc.pos.extra.s2j.row[j].col, "double[]");
6463  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.s2j.row[j].col)/sizeof(target[i].loc.pos.extra.s2j.row[j].col[0]); ++k) {
6464  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6465  add_name(rebasename2, &target[i].loc.pos.extra.s2j.row[j].col[k], "double");
6466  }
6467  }
6468  add_name(basename+".loc.pos.extra.s2t", &target[i].loc.pos.extra.s2t, "rmatrix");
6469  add_name(basename+".loc.pos.extra.s2t.row", &target[i].loc.pos.extra.s2t.row, "rvector[]");
6470  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.s2t.row)/sizeof(target[i].loc.pos.extra.s2t.row[0]); ++j) {
6471  string rebasename = basename + "loc.pos.extra.s2t.row[" + std::to_string(j) + "]";
6472  add_name(rebasename, &target[i].loc.pos.extra.s2t.row[j], "rvector");
6473  add_name(rebasename+".col", &target[i].loc.pos.extra.s2t.row[j].col, "double[]");
6474  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.s2t.row[j].col)/sizeof(target[i].loc.pos.extra.s2t.row[j].col[0]); ++k) {
6475  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6476  add_name(rebasename2, &target[i].loc.pos.extra.s2t.row[j].col[k], "double");
6477  }
6478  }
6479  add_name(basename+".loc.pos.extra.ds2t", &target[i].loc.pos.extra.ds2t, "rmatrix");
6480  add_name(basename+".loc.pos.extra.ds2t.row", &target[i].loc.pos.extra.ds2t.row, "rvector[]");
6481  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.ds2t.row)/sizeof(target[i].loc.pos.extra.ds2t.row[0]); ++j) {
6482  string rebasename = basename + "loc.pos.extra.ds2t.row[" + std::to_string(j) + "]";
6483  add_name(rebasename, &target[i].loc.pos.extra.ds2t.row[j], "rvector");
6484  add_name(rebasename+".col", &target[i].loc.pos.extra.ds2t.row[j].col, "double[]");
6485  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.ds2t.row[j].col)/sizeof(target[i].loc.pos.extra.ds2t.row[j].col[0]); ++k) {
6486  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6487  add_name(rebasename2, &target[i].loc.pos.extra.ds2t.row[j].col[k], "double");
6488  }
6489  }
6490  add_name(basename+".loc.pos.extra.t2s", &target[i].loc.pos.extra.t2s, "rmatrix");
6491  add_name(basename+".loc.pos.extra.t2s.row", &target[i].loc.pos.extra.t2s.row, "rvector[]");
6492  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.t2s.row)/sizeof(target[i].loc.pos.extra.t2s.row[0]); ++j) {
6493  string rebasename = basename + "loc.pos.extra.t2s.row[" + std::to_string(j) + "]";
6494  add_name(rebasename, &target[i].loc.pos.extra.t2s.row[j], "rvector");
6495  add_name(rebasename+".col", &target[i].loc.pos.extra.t2s.row[j].col, "double[]");
6496  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.t2s.row[j].col)/sizeof(target[i].loc.pos.extra.t2s.row[j].col[0]); ++k) {
6497  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6498  add_name(rebasename2, &target[i].loc.pos.extra.t2s.row[j].col[k], "double");
6499  }
6500  }
6501  add_name(basename+".loc.pos.extra.dt2s", &target[i].loc.pos.extra.dt2s, "rmatrix");
6502  add_name(basename+".loc.pos.extra.dt2s.row", &target[i].loc.pos.extra.dt2s.row, "rvector[]");
6503  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.dt2s.row)/sizeof(target[i].loc.pos.extra.dt2s.row[0]); ++j) {
6504  string rebasename = basename + "loc.pos.extra.dt2s.row[" + std::to_string(j) + "]";
6505  add_name(rebasename, &target[i].loc.pos.extra.dt2s.row[j], "rvector");
6506  add_name(rebasename+".col", &target[i].loc.pos.extra.dt2s.row[j].col, "double[]");
6507  for(size_t k = 0; k < sizeof(target[i].loc.pos.extra.dt2s.row[j].col)/sizeof(target[i].loc.pos.extra.dt2s.row[j].col[0]); ++k) {
6508  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6509  add_name(rebasename2, &target[i].loc.pos.extra.dt2s.row[j].col[k], "double");
6510  }
6511  }
6512  add_name(basename+".loc.pos.extra.sun2earth", &target[i].loc.pos.extra.sun2earth, "cartpos");
6513  add_name(basename+".loc.pos.extra.sun2earth.utc", &target[i].loc.pos.extra.sun2earth.utc, "double");
6514  add_name(basename+".loc.pos.extra.sun2earth.s", &target[i].loc.pos.extra.sun2earth.s, "rvector");
6515  add_name(basename+".loc.pos.extra.sun2earth.s.col", &target[i].loc.pos.extra.sun2earth.s.col, "double[]");
6516  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.sun2earth.s.col)/sizeof(target[i].loc.pos.extra.sun2earth.s.col[0]); ++j) {
6517  string rebasename = basename + "loc.pos.extra.sun2earth.s.col[" + std::to_string(j) + "]";
6518  add_name(rebasename, &target[i].loc.pos.extra.sun2earth.s.col[j], "double");
6519  }
6520  add_name(basename+".loc.pos.extra.sun2earth.v", &target[i].loc.pos.extra.sun2earth.v, "rvector");
6521  add_name(basename+".loc.pos.extra.sun2earth.v.col", &target[i].loc.pos.extra.sun2earth.v.col, "double[]");
6522  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.sun2earth.v.col)/sizeof(target[i].loc.pos.extra.sun2earth.v.col[0]); ++j) {
6523  string rebasename = basename + "loc.pos.extra.sun2earth.v.col[" + std::to_string(j) + "]";
6524  add_name(rebasename, &target[i].loc.pos.extra.sun2earth.v.col[j], "double");
6525  }
6526  add_name(basename+".loc.pos.extra.sun2earth.a", &target[i].loc.pos.extra.sun2earth.a, "rvector");
6527  add_name(basename+".loc.pos.extra.sun2earth.a.col", &target[i].loc.pos.extra.sun2earth.a.col, "double[]");
6528  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.sun2earth.a.col)/sizeof(target[i].loc.pos.extra.sun2earth.a.col[0]); ++j) {
6529  string rebasename = basename + "loc.pos.extra.sun2earth.a.col[" + std::to_string(j) + "]";
6530  add_name(rebasename, &target[i].loc.pos.extra.sun2earth.a.col[j], "double");
6531  }
6532  add_name(basename+".loc.pos.extra.sun2earth.pass", &target[i].loc.pos.extra.sun2earth.pass, "uint32_t");
6533  add_name(basename+".loc.pos.extra.sun2moon", &target[i].loc.pos.extra.sun2moon, "cartpos");
6534  add_name(basename+".loc.pos.extra.sun2moon.utc", &target[i].loc.pos.extra.sun2moon.utc, "double");
6535  add_name(basename+".loc.pos.extra.sun2moon.s", &target[i].loc.pos.extra.sun2moon.s, "rvector");
6536  add_name(basename+".loc.pos.extra.sun2moon.s.col", &target[i].loc.pos.extra.sun2moon.s.col, "double[]");
6537  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.sun2moon.s.col)/sizeof(target[i].loc.pos.extra.sun2moon.s.col[0]); ++j) {
6538  string rebasename = basename + "loc.pos.extra.sun2moon.s.col[" + std::to_string(j) + "]";
6539  add_name(rebasename, &target[i].loc.pos.extra.sun2moon.s.col[j], "double");
6540  }
6541  add_name(basename+".loc.pos.extra.sun2moon.v", &target[i].loc.pos.extra.sun2moon.v, "rvector");
6542  add_name(basename+".loc.pos.extra.sun2moon.v.col", &target[i].loc.pos.extra.sun2moon.v.col, "double[]");
6543  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.sun2moon.v.col)/sizeof(target[i].loc.pos.extra.sun2moon.v.col[0]); ++j) {
6544  string rebasename = basename + "loc.pos.extra.sun2moon.v.col[" + std::to_string(j) + "]";
6545  add_name(rebasename, &target[i].loc.pos.extra.sun2moon.v.col[j], "double");
6546  }
6547  add_name(basename+".loc.pos.extra.sun2moon.a", &target[i].loc.pos.extra.sun2moon.a, "rvector");
6548  add_name(basename+".loc.pos.extra.sun2moon.a.col", &target[i].loc.pos.extra.sun2moon.a.col, "double[]");
6549  for(size_t j = 0; j < sizeof(target[i].loc.pos.extra.sun2moon.a.col)/sizeof(target[i].loc.pos.extra.sun2moon.a.col[0]); ++j) {
6550  string rebasename = basename + "loc.pos.extra.sun2moon.a.col[" + std::to_string(j) + "]";
6551  add_name(rebasename, &target[i].loc.pos.extra.sun2moon.a.col[j], "double");
6552  }
6553  add_name(basename+".loc.pos.extra.sun2moon.pass", &target[i].loc.pos.extra.sun2moon.pass, "uint32_t");
6554  add_name(basename+".loc.pos.extra.closest", &target[i].loc.pos.extra.closest, "uint16_t");
6555  add_name(basename+".loc.pos.earthsep", &target[i].loc.pos.earthsep, "float");
6556  add_name(basename+".loc.pos.moonsep", &target[i].loc.pos.moonsep, "float");
6557  add_name(basename+".loc.pos.sunsize", &target[i].loc.pos.sunsize, "float");
6558  add_name(basename+".loc.pos.sunradiance", &target[i].loc.pos.sunradiance, "float");
6559  add_name(basename+".loc.pos.bearth", &target[i].loc.pos.bearth, "rvector");
6560  add_name(basename+".loc.pos.bearth.col", &target[i].loc.pos.bearth.col, "double[]");
6561  for(size_t j = 0; j < sizeof(target[i].loc.pos.bearth.col)/sizeof(target[i].loc.pos.bearth.col[0]); ++j) {
6562  string rebasename = basename + "loc.pos.bearth.col[" + std::to_string(j) + "]";
6563  add_name(rebasename, &target[i].loc.pos.bearth.col[j], "double");
6564  }
6565  add_name(basename+".loc.pos.orbit", &target[i].loc.pos.orbit, "double");
6566  add_name(basename+".loc.att", &target[i].loc.att, "attstruc");
6567  add_name(basename+".loc.att.utc", &target[i].loc.att.utc, "double");
6568  add_name(basename+".loc.att.topo", &target[i].loc.att.topo, "qatt");
6569  add_name(basename+".loc.att.topo.utc", &target[i].loc.att.topo.utc, "double");
6570  add_name(basename+".loc.att.topo.s", &target[i].loc.att.topo.s, "quaternion");
6571  add_name(basename+".loc.att.topo.s.d", &target[i].loc.att.topo.s.d, "cvector");
6572  add_name(basename+".loc.att.topo.s.d.x", &target[i].loc.att.topo.s.d.x, "double");
6573  add_name(basename+".loc.att.topo.s.d.y", &target[i].loc.att.topo.s.d.y, "double");
6574  add_name(basename+".loc.att.topo.s.d.z", &target[i].loc.att.topo.s.d.z, "double");
6575  add_name(basename+".loc.att.topo.s.w", &target[i].loc.att.topo.s.w, "double");
6576  add_name(basename+".loc.att.topo.v", &target[i].loc.att.topo.v, "rvector");
6577  add_name(basename+".loc.att.topo.v.col", &target[i].loc.att.topo.v.col, "double[]");
6578  for(size_t j = 0; j < sizeof(target[i].loc.att.topo.v.col)/sizeof(target[i].loc.att.topo.v.col[0]); ++j) {
6579  string rebasename = basename + "loc.att.topo.v.col[" + std::to_string(j) + "]";
6580  add_name(rebasename, &target[i].loc.att.topo.v.col[j], "double");
6581  }
6582  add_name(basename+".loc.att.topo.a", &target[i].loc.att.topo.a, "rvector");
6583  add_name(basename+".loc.att.topo.a.col", &target[i].loc.att.topo.a.col, "double[]");
6584  for(size_t j = 0; j < sizeof(target[i].loc.att.topo.a.col)/sizeof(target[i].loc.att.topo.a.col[0]); ++j) {
6585  string rebasename = basename + "loc.att.topo.a.col[" + std::to_string(j) + "]";
6586  add_name(rebasename, &target[i].loc.att.topo.a.col[j], "double");
6587  }
6588  add_name(basename+".loc.att.topo.pass", &target[i].loc.att.topo.pass, "uint32_t");
6589  add_name(basename+".loc.att.lvlh", &target[i].loc.att.lvlh, "qatt");
6590  add_name(basename+".loc.att.lvlh.utc", &target[i].loc.att.lvlh.utc, "double");
6591  add_name(basename+".loc.att.lvlh.s", &target[i].loc.att.lvlh.s, "quaternion");
6592  add_name(basename+".loc.att.lvlh.s.d", &target[i].loc.att.lvlh.s.d, "cvector");
6593  add_name(basename+".loc.att.lvlh.s.d.x", &target[i].loc.att.lvlh.s.d.x, "double");
6594  add_name(basename+".loc.att.lvlh.s.d.y", &target[i].loc.att.lvlh.s.d.y, "double");
6595  add_name(basename+".loc.att.lvlh.s.d.z", &target[i].loc.att.lvlh.s.d.z, "double");
6596  add_name(basename+".loc.att.lvlh.s.w", &target[i].loc.att.lvlh.s.w, "double");
6597  add_name(basename+".loc.att.lvlh.v", &target[i].loc.att.lvlh.v, "rvector");
6598  add_name(basename+".loc.att.lvlh.v.col", &target[i].loc.att.lvlh.v.col, "double[]");
6599  for(size_t j = 0; j < sizeof(target[i].loc.att.lvlh.v.col)/sizeof(target[i].loc.att.lvlh.v.col[0]); ++j) {
6600  string rebasename = basename + "loc.att.lvlh.v.col[" + std::to_string(j) + "]";
6601  add_name(rebasename, &target[i].loc.att.lvlh.v.col[j], "double");
6602  }
6603  add_name(basename+".loc.att.lvlh.a", &target[i].loc.att.lvlh.a, "rvector");
6604  add_name(basename+".loc.att.lvlh.a.col", &target[i].loc.att.lvlh.a.col, "double[]");
6605  for(size_t j = 0; j < sizeof(target[i].loc.att.lvlh.a.col)/sizeof(target[i].loc.att.lvlh.a.col[0]); ++j) {
6606  string rebasename = basename + "loc.att.lvlh.a.col[" + std::to_string(j) + "]";
6607  add_name(rebasename, &target[i].loc.att.lvlh.a.col[j], "double");
6608  }
6609  add_name(basename+".loc.att.lvlh.pass", &target[i].loc.att.lvlh.pass, "uint32_t");
6610  add_name(basename+".loc.att.geoc", &target[i].loc.att.geoc, "qatt");
6611  add_name(basename+".loc.att.geoc.utc", &target[i].loc.att.geoc.utc, "double");
6612  add_name(basename+".loc.att.geoc.s", &target[i].loc.att.geoc.s, "quaternion");
6613  add_name(basename+".loc.att.geoc.s.d", &target[i].loc.att.geoc.s.d, "cvector");
6614  add_name(basename+".loc.att.geoc.s.d.x", &target[i].loc.att.geoc.s.d.x, "double");
6615  add_name(basename+".loc.att.geoc.s.d.y", &target[i].loc.att.geoc.s.d.y, "double");
6616  add_name(basename+".loc.att.geoc.s.d.z", &target[i].loc.att.geoc.s.d.z, "double");
6617  add_name(basename+".loc.att.geoc.s.w", &target[i].loc.att.geoc.s.w, "double");
6618  add_name(basename+".loc.att.geoc.v", &target[i].loc.att.geoc.v, "rvector");
6619  add_name(basename+".loc.att.geoc.v.col", &target[i].loc.att.geoc.v.col, "double[]");
6620  for(size_t j = 0; j < sizeof(target[i].loc.att.geoc.v.col)/sizeof(target[i].loc.att.geoc.v.col[0]); ++j) {
6621  string rebasename = basename + "loc.att.geoc.v.col[" + std::to_string(j) + "]";
6622  add_name(rebasename, &target[i].loc.att.geoc.v.col[j], "double");
6623  }
6624  add_name(basename+".loc.att.geoc.a", &target[i].loc.att.geoc.a, "rvector");
6625  add_name(basename+".loc.att.geoc.a.col", &target[i].loc.att.geoc.a.col, "double[]");
6626  for(size_t j = 0; j < sizeof(target[i].loc.att.geoc.a.col)/sizeof(target[i].loc.att.geoc.a.col[0]); ++j) {
6627  string rebasename = basename + "loc.att.geoc.a.col[" + std::to_string(j) + "]";
6628  add_name(rebasename, &target[i].loc.att.geoc.a.col[j], "double");
6629  }
6630  add_name(basename+".loc.att.geoc.pass", &target[i].loc.att.geoc.pass, "uint32_t");
6631  add_name(basename+".loc.att.selc", &target[i].loc.att.selc, "qatt");
6632  add_name(basename+".loc.att.selc.utc", &target[i].loc.att.selc.utc, "double");
6633  add_name(basename+".loc.att.selc.s", &target[i].loc.att.selc.s, "quaternion");
6634  add_name(basename+".loc.att.selc.s.d", &target[i].loc.att.selc.s.d, "cvector");
6635  add_name(basename+".loc.att.selc.s.d.x", &target[i].loc.att.selc.s.d.x, "double");
6636  add_name(basename+".loc.att.selc.s.d.y", &target[i].loc.att.selc.s.d.y, "double");
6637  add_name(basename+".loc.att.selc.s.d.z", &target[i].loc.att.selc.s.d.z, "double");
6638  add_name(basename+".loc.att.selc.s.w", &target[i].loc.att.selc.s.w, "double");
6639  add_name(basename+".loc.att.selc.v", &target[i].loc.att.selc.v, "rvector");
6640  add_name(basename+".loc.att.selc.v.col", &target[i].loc.att.selc.v.col, "double[]");
6641  for(size_t j = 0; j < sizeof(target[i].loc.att.selc.v.col)/sizeof(target[i].loc.att.selc.v.col[0]); ++j) {
6642  string rebasename = basename + "loc.att.selc.v.col[" + std::to_string(j) + "]";
6643  add_name(rebasename, &target[i].loc.att.selc.v.col[j], "double");
6644  }
6645  add_name(basename+".loc.att.selc.a", &target[i].loc.att.selc.a, "rvector");
6646  add_name(basename+".loc.att.selc.a.col", &target[i].loc.att.selc.a.col, "double[]");
6647  for(size_t j = 0; j < sizeof(target[i].loc.att.selc.a.col)/sizeof(target[i].loc.att.selc.a.col[0]); ++j) {
6648  string rebasename = basename + "loc.att.selc.a.col[" + std::to_string(j) + "]";
6649  add_name(rebasename, &target[i].loc.att.selc.a.col[j], "double");
6650  }
6651  add_name(basename+".loc.att.selc.pass", &target[i].loc.att.selc.pass, "uint32_t");
6652  add_name(basename+".loc.att.icrf", &target[i].loc.att.icrf, "qatt");
6653  add_name(basename+".loc.att.icrf.utc", &target[i].loc.att.icrf.utc, "double");
6654  add_name(basename+".loc.att.icrf.s", &target[i].loc.att.icrf.s, "quaternion");
6655  add_name(basename+".loc.att.icrf.s.d", &target[i].loc.att.icrf.s.d, "cvector");
6656  add_name(basename+".loc.att.icrf.s.d.x", &target[i].loc.att.icrf.s.d.x, "double");
6657  add_name(basename+".loc.att.icrf.s.d.y", &target[i].loc.att.icrf.s.d.y, "double");
6658  add_name(basename+".loc.att.icrf.s.d.z", &target[i].loc.att.icrf.s.d.z, "double");
6659  add_name(basename+".loc.att.icrf.s.w", &target[i].loc.att.icrf.s.w, "double");
6660  add_name(basename+".loc.att.icrf.v", &target[i].loc.att.icrf.v, "rvector");
6661  add_name(basename+".loc.att.icrf.v.col", &target[i].loc.att.icrf.v.col, "double[]");
6662  for(size_t j = 0; j < sizeof(target[i].loc.att.icrf.v.col)/sizeof(target[i].loc.att.icrf.v.col[0]); ++j) {
6663  string rebasename = basename + "loc.att.icrf.v.col[" + std::to_string(j) + "]";
6664  add_name(rebasename, &target[i].loc.att.icrf.v.col[j], "double");
6665  }
6666  add_name(basename+".loc.att.icrf.a", &target[i].loc.att.icrf.a, "rvector");
6667  add_name(basename+".loc.att.icrf.a.col", &target[i].loc.att.icrf.a.col, "double[]");
6668  for(size_t j = 0; j < sizeof(target[i].loc.att.icrf.a.col)/sizeof(target[i].loc.att.icrf.a.col[0]); ++j) {
6669  string rebasename = basename + "loc.att.icrf.a.col[" + std::to_string(j) + "]";
6670  add_name(rebasename, &target[i].loc.att.icrf.a.col[j], "double");
6671  }
6672  add_name(basename+".loc.att.icrf.pass", &target[i].loc.att.icrf.pass, "uint32_t");
6673  add_name(basename+".loc.att.extra", &target[i].loc.att.extra, "extraatt");
6674  add_name(basename+".loc.att.extra.utc", &target[i].loc.att.extra.utc, "double");
6675  add_name(basename+".loc.att.extra.j2b", &target[i].loc.att.extra.j2b, "rmatrix");
6676  add_name(basename+".loc.att.extra.j2b.row", &target[i].loc.att.extra.j2b.row, "rvector[]");
6677  for(size_t j = 0; j < sizeof(target[i].loc.att.extra.j2b.row)/sizeof(target[i].loc.att.extra.j2b.row[0]); ++j) {
6678  string rebasename = basename + "loc.att.extra.j2b.row[" + std::to_string(j) + "]";
6679  add_name(rebasename, &target[i].loc.att.extra.j2b.row[j], "rvector");
6680  add_name(rebasename+".col", &target[i].loc.att.extra.j2b.row[j].col, "double[]");
6681  for(size_t k = 0; k < sizeof(target[i].loc.att.extra.j2b.row[j].col)/sizeof(target[i].loc.att.extra.j2b.row[j].col[0]); ++k) {
6682  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6683  add_name(rebasename2, &target[i].loc.att.extra.j2b.row[j].col[k], "double");
6684  }
6685  }
6686  add_name(basename+".loc.att.extra.b2j", &target[i].loc.att.extra.b2j, "rmatrix");
6687  add_name(basename+".loc.att.extra.b2j.row", &target[i].loc.att.extra.b2j.row, "rvector[]");
6688  for(size_t j = 0; j < sizeof(target[i].loc.att.extra.b2j.row)/sizeof(target[i].loc.att.extra.b2j.row[0]); ++j) {
6689  string rebasename = basename + "loc.att.extra.b2j.row[" + std::to_string(j) + "]";
6690  add_name(rebasename, &target[i].loc.att.extra.b2j.row[j], "rvector");
6691  add_name(rebasename+".col", &target[i].loc.att.extra.b2j.row[j].col, "double[]");
6692  for(size_t k = 0; k < sizeof(target[i].loc.att.extra.b2j.row[j].col)/sizeof(target[i].loc.att.extra.b2j.row[j].col[0]); ++k) {
6693  string rebasename2 = rebasename + ".col[" + std::to_string(k) + "]";
6694  add_name(rebasename2, &target[i].loc.att.extra.b2j.row[j].col[k], "double");
6695  }
6696  }
6697  }
6698 
6699 
6700  // vector<userstruc> user
6701  add_name("user", &user, "vector<userstruc>");
6702  for(size_t i = 0; i < user.capacity(); ++i) {
6703  string basename = "user[" + std::to_string(i) + "]";
6704  add_name(basename, &user[i], "userstruc");
6705  add_name(basename+".name", &user[i].name, "string");
6706  add_name(basename+".node", &user[i].node, "string");
6707  add_name(basename+".tool", &user[i].tool, "string");
6708  add_name(basename+".cpu", &user[i].cpu, "string");
6709  }
6710 
6711  // vector<tlestruc> tle
6712  add_name("tle", &tle, "vector<tlestruc>");
6713  for(size_t i = 0; i < tle.capacity(); ++i) {
6714  string basename = "tle[" + std::to_string(i) + "]";
6715  add_name(basename, &tle[i], "tlestruc");
6716  add_name(basename+".utc", &tle[i].utc, "double");
6717  add_name(basename+".name", &tle[i].name, "char[]");
6718  add_name(basename+".snumber", &tle[i].snumber, "uint16_t");
6719  add_name(basename+".id", &tle[i].id, "char[]");
6720  add_name(basename+".bstar", &tle[i].bstar, "double");
6721  add_name(basename+".i", &tle[i].i, "double");
6722  add_name(basename+".raan", &tle[i].raan, "double");
6723  add_name(basename+".e", &tle[i].e, "double");
6724  add_name(basename+".ap", &tle[i].ap, "double");
6725  add_name(basename+".ma", &tle[i].ma, "double");
6726  add_name(basename+".mm", &tle[i].mm, "double");
6727  add_name(basename+".orbit", &tle[i].orbit, "uint32_t");
6728  }
6729 
6730  // jsonnode json
6731  add_name("json", &json, "jsonnode");
6732  add_name("json.name", &json.name, "string");
6733  add_name("json.node", &json.node, "string");
6734  add_name("json.state", &json.state, "string");
6735  add_name("json.utcstart", &json.utcstart, "string");
6736  add_name("json.vertexs", &json.vertexs, "string");
6737  add_name("json.faces", &json.faces, "string");
6738  add_name("json.pieces", &json.pieces, "string");
6739  add_name("json.devgen", &json.devgen, "string");
6740  add_name("json.devspec", &json.devspec, "string");
6741  add_name("json.ports", &json.ports, "string");
6742  add_name("json.targets", &json.targets, "string");
6743 
6744 
6745  }
6746 
6748 
6753  string get_name(void* v) {
6754  name_map::const_iterator it = names.begin();
6755  while(it->second != v && it != names.end()) { it++; }
6756  if(it == names.end()) { cerr<<"address <"<<v<<"> not found!"<<endl; return ""; }
6757  return it->first;
6758  }
6759 
6761 
6766  string get_type(const string& s) const {
6767  type_map::const_iterator it = types.find(s);
6768  if(it == types.end()) { /*cerr<<"type for <"<<s<<"> not found!"<<endl;*/ return ""; }
6769  return it->second;
6770  }
6771 
6773 
6778  template<class T>
6779  T* get_pointer(const string& s) const {
6780  name_map::const_iterator it = names.find(s);
6781  if(it == names.end()) { cerr<<"name <"<<s<<"> not found!"<<endl; return nullptr; }
6782  return (T*)(it->second);
6783  }
6784 
6786 
6791  template<class T>
6792  T get_value(const string& s) const {
6793  // change to static null object?
6794  T dummy = T();
6795  name_map::const_iterator it = names.find(s);
6796  if(it == names.end()) { cerr<<"name <"<<s<<"> not found!"<<endl; return dummy; }
6797  return *get_pointer<T>(s);
6798  }
6799 
6801 
6807  template<class T>
6808  void set_value(const string& s, const T& value) const {
6809  // maybe if not found should be inserted?? hmmm.... ask Eric
6810  name_map::const_iterator it = names.find(s);
6811  if(it == names.end()) { cerr<<"name <"<<s<<"> not found!"<<endl; return; }
6812  *get_pointer<T>(s) = value;
6813  }
6814 
6815  // TODO: add support for multiple JSON string concatenated
6817 
6822  void set_json(const string& json) {
6823  cout<<"\tJSON received = <"<<json<<">"<<endl;
6824  string error;
6825  vector<json11::Json> vp = json11::Json::parse_multi(json,error);
6826  cout<<"\tJSON error = <"<<error<<">"<<endl;
6827  for(size_t i = 0; i < vp.size(); ++i) {
6828  json11::Json p = vp[i];
6829 
6830  string name(p.object_items().begin()->first);
6831  cout<<"\tJSON name = <"<<name<<">"<<endl;
6832  if(error.empty()) {
6833  if(!p[name].is_null()) {
6834  if(name_exists(name)) {
6835  string type = get_type(name);
6836  // base data type
6837  if(type == "string") {
6838  set_value<string>(name, p[name].string_value());
6839  } else if(type == "double") {
6840  set_value<double>(name, p[name].number_value());
6841  } else if (type == "float") {
6842  set_value<float>(name, p[name].number_value());
6843  } else if (type == "int") {
6844  set_value<int>(name, p[name].int_value());
6845  } else if (type == "bool") {
6846  set_value<bool>(name, p[name].bool_value());
6847  } else if (type == "uint32_t") {
6848  set_value<uint32_t>(name, p[name].int_value());
6849  } else if (type == "int32_t") {
6850  set_value<int32_t>(name, p[name].int_value());
6851  } else if (type == "uint16_t") {
6852  set_value<uint16_t>(name, p[name].int_value());
6853  } else if (type == "int16_t") {
6854  set_value<int16_t>(name, p[name].int_value());
6855  } else if (type == "uint8_t") {
6856  set_value<uint8_t>(name, p[name].int_value());
6857  } else if (type == "int8_t") {
6858  set_value<int8_t>(name, p[name].int_value());
6859  } else if (type == "size_t") {
6860  set_value<size_t>(name, p[name].int_value());
6861 
6862  // user-defined types
6863  } else if (type == "agent_request_entry") {
6864  //get_pointer<agent_request_entry>(name)->from_json(json);
6865  } else if (type == "agentstruc") {
6866  get_pointer<agentstruc>(name)->from_json(json);
6867  } else if (type == "attstruc") {
6868  get_pointer<attstruc>(name)->from_json(json);
6869  } else if (type == "beatstruc") {
6870  get_pointer<beatstruc>(name)->from_json(json);
6871  } else if (type == "cartpos") {
6872  get_pointer<cartpos>(name)->from_json(json);
6873  } else if (type == "cosmosstruc") {
6874  get_pointer<cosmosstruc>(name)->from_json(json);
6875  } else if (type == "cvector") {
6876  get_pointer<cvector>(name)->from_json(json);
6877  } else if (type == "devicestruc") {
6878  get_pointer<devicestruc>(name)->from_json(json);
6879  } else if (type == "devspecstruc") {
6880  get_pointer<devspecstruc>(name)->from_json(json);
6881  } else if (type == "equationstruc") {
6882  get_pointer<equationstruc>(name)->from_json(json);
6883  } else if (type == "eventstruc") {
6884  get_pointer<eventstruc>(name)->from_json(json);
6885  } else if (type == "extraatt") {
6886  get_pointer<extraatt>(name)->from_json(json);
6887  } else if (type == "extrapos") {
6888  get_pointer<extrapos>(name)->from_json(json);
6889  } else if (type == "face") {
6890  get_pointer<Cosmos::wavefront::face>(name)->from_json(json);
6891  } else if (type == "facestruc") {
6892  get_pointer<facestruc>(name)->from_json(json);
6893  } else if (type == "geoidpos") {
6894  get_pointer<geoidpos>(name)->from_json(json);
6895  } else if (type == "group") {
6896  get_pointer<Cosmos::wavefront::group>(name)->from_json(json);
6897  } else if (type == "gvector") {
6898  get_pointer<gvector>(name)->from_json(json);
6899  } else if (type == "jsonhandle") {
6900  get_pointer<jsonhandle>(name)->from_json(json);
6901  } else if (type == "jsonnode") {
6902  get_pointer<jsonnode>(name)->from_json(json);
6903  } else if (type == "line") {
6904  get_pointer<Cosmos::wavefront::line>(name)->from_json(json);
6905  } else if (type == "locstruc") {
6906  get_pointer<locstruc>(name)->from_json(json);
6907  } else if (type == "material") {
6908  get_pointer<Cosmos::wavefront::material>(name)->from_json(json);
6909  } else if (type == "NetworkType") {
6910  //get_pointer<NetworkType>(name)->from_json(json);
6911  } else if (type == "nodestruc") {
6912  get_pointer<nodestruc>(name)->from_json(json);
6913  } else if (type == "physicsstruc") {
6914  get_pointer<physicsstruc>(name)->from_json(json);
6915  } else if (type == "piecestruc") {
6916  get_pointer<piecestruc>(name)->from_json(json);
6917  } else if (type == "point") {
6918  get_pointer<Cosmos::wavefront::point>(name)->from_json(json);
6919  } else if (type == "portstruc") {
6920  get_pointer<portstruc>(name)->from_json(json);
6921  } else if (type == "PORT_TYPE") {
6922  set_value<PORT_TYPE>(name, static_cast<PORT_TYPE>(p[name].int_value()));
6923  } else if (type == "posstruc") {
6924  get_pointer<posstruc>(name)->from_json(json);
6925  } else if (type == "qatt") {
6926  get_pointer<qatt>(name)->from_json(json);
6927  } else if (type == "quaternion") {
6928  get_pointer<quaternion>(name)->from_json(json);
6929  } else if (type == "rmatrix") {
6930  get_pointer<rmatrix>(name)->from_json(json);
6931  } else if (type == "rvector") {
6932  get_pointer<rvector>(name)->from_json(json);
6933  } else if (type == "socket_channel") {
6934  //get_pointer<socket_channel>(name)->from_json(json);
6935  } else if (type == "spherpos") {
6936  get_pointer<spherpos>(name)->from_json(json);
6937  } else if (type == "svector") {
6938  get_pointer<svector>(name)->from_json(json);
6939  } else if (type == "targetstruc") {
6940  get_pointer<targetstruc>(name)->from_json(json);
6941  } else if (type == "tlestruc") {
6942  get_pointer<tlestruc>(name)->from_json(json);
6943  } else if (type == "trianglestruc") {
6944  get_pointer<trianglestruc>(name)->from_json(json);
6945  } else if (type == "unitstruc") {
6946  get_pointer<unitstruc>(name)->from_json(json);
6947  } else if (type == "userstruc") {
6948  get_pointer<userstruc>(name)->from_json(json);
6949  } else if (type == "Vector") {
6950  get_pointer<Vector>(name)->from_json(json);
6951  } else if (type == "vertexstruc") {
6952  get_pointer<vertexstruc>(name)->from_json(json);
6953  } else if (type == "wavefront") {
6954  get_pointer<wavefront>(name)->from_json(json);
6955 
6956  // vector of base types
6957  } else if (type == "vector<uint32_t>") {
6958  for(size_t i = 0; i < get_pointer<vector<uint32_t>>(name)->size(); ++i) {
6959  if(!p[name][i].is_null()) {
6960  get_pointer<vector<uint32_t>>(name)->at(i) = p[name][i].int_value();
6961  }
6962  }
6963  } else if (type == "vector<vector<uint32_t>>") {
6964  for(size_t i = 0; i < get_pointer<vector<vector<uint32_t>>>(name)->size(); ++i) {
6965  for(size_t j = 0; j < get_pointer<vector<vector<uint32_t>>>(name)->at(i).size(); ++j) {
6966  if(!p[name][i][j].is_null()) {
6967  get_pointer<vector<vector<uint32_t>>>(name)->at(i).at(j) = p[name][i][j].int_value();
6968  }
6969  }
6970  }
6971  } else if (type == "vector<int32_t>") {
6972  for(size_t i = 0; i < get_pointer<vector<int32_t>>(name)->size(); ++i) {
6973  if(!p[name][i].is_null()) {
6974  get_pointer<vector<int32_t>>(name)->at(i) = p[name][i].int_value();
6975  }
6976  }
6977  } else if (type == "vector<vector<int32_t>>") {
6978  for(size_t i = 0; i < get_pointer<vector<vector<int32_t>>>(name)->size(); ++i) {
6979  for(size_t j = 0; j < get_pointer<vector<vector<int32_t>>>(name)->at(i).size(); ++j) {
6980  if(!p[name][i][j].is_null()) {
6981  get_pointer<vector<vector<int32_t>>>(name)->at(i).at(j) = p[name][i][j].int_value();
6982  }
6983  }
6984  }
6985  } else if (type == "vector<uint16_t>") {
6986  for(size_t i = 0; i < get_pointer<vector<uint16_t>>(name)->size(); ++i) {
6987  if(!p[name][i].is_null()) {
6988  get_pointer<vector<uint16_t>>(name)->at(i) = p[name][i].int_value();
6989  }
6990  }
6991  } else if (type == "vector<vector<uint16_t>>") {
6992  for(size_t i = 0; i < get_pointer<vector<vector<uint16_t>>>(name)->size(); ++i) {
6993  for(size_t j = 0; j < get_pointer<vector<vector<uint16_t>>>(name)->at(i).size(); ++j) {
6994  if(!p[name][i][j].is_null()) {
6995  get_pointer<vector<vector<uint16_t>>>(name)->at(i).at(j) = p[name][i][j].int_value();
6996  }
6997  }
6998  }
6999  } else if (type == "vector<int16_t>") {
7000  for(size_t i = 0; i < get_pointer<vector<int16_t>>(name)->size(); ++i) {
7001  if(!p[name][i].is_null()) {
7002  get_pointer<vector<int16_t>>(name)->at(i) = p[name][i].int_value();
7003  }
7004  }
7005  } else if (type == "vector<vector<int16_t>>") {
7006  for(size_t i = 0; i < get_pointer<vector<vector<int16_t>>>(name)->size(); ++i) {
7007  for(size_t j = 0; j < get_pointer<vector<vector<int16_t>>>(name)->at(i).size(); ++j) {
7008  if(!p[name][i][j].is_null()) {
7009  get_pointer<vector<vector<int16_t>>>(name)->at(i).at(j) = p[name][i][j].int_value();
7010  }
7011  }
7012  }
7013  } else if (type == "vector<uint8_t>") {
7014  for(size_t i = 0; i < get_pointer<vector<uint8_t>>(name)->size(); ++i) {
7015  if(!p[name][i].is_null()) {
7016  get_pointer<vector<uint8_t>>(name)->at(i) = p[name][i].int_value();
7017  }
7018  }
7019  } else if (type == "vector<vector<uint8_t>>") {
7020  for(size_t i = 0; i < get_pointer<vector<vector<uint8_t>>>(name)->size(); ++i) {
7021  for(size_t j = 0; j < get_pointer<vector<vector<uint8_t>>>(name)->at(i).size(); ++j) {
7022  if(!p[name][i][j].is_null()) {
7023  get_pointer<vector<vector<uint8_t>>>(name)->at(i).at(j) = p[name][i][j].int_value();
7024  }
7025  }
7026  }
7027  } else if (type == "vector<int8_t>") {
7028  for(size_t i = 0; i < get_pointer<vector<int8_t>>(name)->size(); ++i) {
7029  if(!p[name][i].is_null()) {
7030  get_pointer<vector<int8_t>>(name)->at(i) = p[name][i].int_value();
7031  }
7032  }
7033  } else if (type == "vector<vector<int8_t>>") {
7034  for(size_t i = 0; i < get_pointer<vector<vector<int8_t>>>(name)->size(); ++i) {
7035  for(size_t j = 0; j < get_pointer<vector<vector<int8_t>>>(name)->at(i).size(); ++j) {
7036  if(!p[name][i][j].is_null()) {
7037  get_pointer<vector<vector<int8_t>>>(name)->at(i).at(j) = p[name][i][j].int_value();
7038  }
7039  }
7040  }
7041  } else if (type == "vector<int>") {
7042  for(size_t i = 0; i < get_pointer<vector<int>>(name)->size(); ++i) {
7043  if(!p[name][i].is_null()) {
7044  get_pointer<vector<int>>(name)->at(i) = p[name][i].int_value();
7045  }
7046  }
7047  } else if (type == "vector<vector<int>>") {
7048  for(size_t i = 0; i < get_pointer<vector<vector<int>>>(name)->size(); ++i) {
7049  for(size_t j = 0; j < get_pointer<vector<vector<int>>>(name)->at(i).size(); ++j) {
7050  if(!p[name][i][j].is_null()) {
7051  get_pointer<vector<vector<int>>>(name)->at(i).at(j) = p[name][i][j].int_value();
7052  }
7053  }
7054  }
7055  } else if (type == "vector<size_t>") {
7056  for(size_t i = 0; i < get_pointer<vector<size_t>>(name)->size(); ++i) {
7057  if(!p[name][i].is_null()) {
7058  get_pointer<vector<size_t>>(name)->at(i) = p[name][i].int_value();
7059  }
7060  }
7061  } else if (type == "vector<vector<size_t>>") {
7062  for(size_t i = 0; i < get_pointer<vector<vector<size_t>>>(name)->size(); ++i) {
7063  for(size_t j = 0; j < get_pointer<vector<vector<size_t>>>(name)->at(i).size(); ++j) {
7064  if(!p[name][i][j].is_null()) {
7065  get_pointer<vector<vector<size_t>>>(name)->at(i).at(j) = p[name][i][j].int_value();
7066  }
7067  }
7068  }
7069  } else if (type == "vector<bool>") {
7070  for(size_t i = 0; i < get_pointer<vector<bool>>(name)->size(); ++i) {
7071  if(!p[name][i].is_null()) {
7072  get_pointer<vector<bool>>(name)->at(i) = p[name][i].bool_value();
7073  }
7074  }
7075  } else if (type == "vector<vector<bool>>") {
7076  for(size_t i = 0; i < get_pointer<vector<vector<bool>>>(name)->size(); ++i) {
7077  for(size_t j = 0; j < get_pointer<vector<vector<bool>>>(name)->at(i).size(); ++j) {
7078  if(!p[name][i][j].is_null()) {
7079  get_pointer<vector<vector<bool>>>(name)->at(i).at(j) = p[name][i][j].bool_value();
7080  }
7081  }
7082  }
7083  } else if (type == "vector<string>") {
7084  for(size_t i = 0; i < get_pointer<vector<string>>(name)->size(); ++i) {
7085  if(!p[name][i].is_null()) {
7086  get_pointer<vector<string>>(name)->at(i) = p[name][i].string_value();
7087  }
7088  }
7089  } else if (type == "vector<vector<string>>") {
7090  for(size_t i = 0; i < get_pointer<vector<vector<string>>>(name)->size(); ++i) {
7091  for(size_t j = 0; j < get_pointer<vector<vector<string>>>(name)->at(i).size(); ++j) {
7092  if(!p[name][i][j].is_null()) {
7093  get_pointer<vector<vector<string>>>(name)->at(i).at(j) = p[name][i][j].string_value();
7094  }
7095  }
7096  }
7097  } else if (type == "vector<float>") {
7098  for(size_t i = 0; i < get_pointer<vector<float>>(name)->size(); ++i) {
7099  if(!p[name][i].is_null()) {
7100  get_pointer<vector<float>>(name)->at(i) = p[name][i].number_value();
7101  }
7102  }
7103  } else if (type == "vector<vector<float>>") {
7104  for(size_t i = 0; i < get_pointer<vector<vector<float>>>(name)->size(); ++i) {
7105  for(size_t j = 0; j < get_pointer<vector<vector<float>>>(name)->at(i).size(); ++j) {
7106  if(!p[name][i][j].is_null()) {
7107  get_pointer<vector<vector<float>>>(name)->at(i).at(j) = p[name][i][j].number_value();
7108  }
7109  }
7110  }
7111  } else if (type == "vector<double>") {
7112  for(size_t i = 0; i < get_pointer<vector<double>>(name)->size(); ++i) {
7113  if(!p[name][i].is_null()) {
7114  get_pointer<vector<double>>(name)->at(i) = p[name][i].number_value();
7115  }
7116  }
7117  } else if (type == "vector<vector<double>>") {
7118  for(size_t i = 0; i < get_pointer<vector<vector<double>>>(name)->size(); ++i) {
7119  for(size_t j = 0; j < get_pointer<vector<vector<double>>>(name)->at(i).size(); ++j) {
7120  if(!p[name][i][j].is_null()) {
7121  get_pointer<vector<vector<double>>>(name)->at(i).at(j) = p[name][i][j].number_value();
7122  }
7123  }
7124  }
7125 
7126  // vector of user-defined types
7127  //} else if (type == "vector<agent_request_entry>") {
7128  // for(size_t i = 0; i < get_pointer<vector<agent_request_entry>>(name)->size(); ++i) {
7129  // if(!p[name][i].is_null()) {
7130  // get_pointer<vector<agent_request_entry>>(name)->at(i).from_json(p[name][i].dump());
7131  // }
7132  // }
7133  } else if (type == "vector<agentstruc>") {
7134  for(size_t i = 0; i < get_pointer<vector<agentstruc>>(name)->size(); ++i) {
7135  if(!p[name][i].is_null()) {
7136  get_pointer<vector<agentstruc>>(name)->at(i).from_json(p[name][i].dump());
7137  }
7138  }
7139  } else if (type == "vector<devicestruc>") {
7140  for(size_t i = 0; i < get_pointer<vector<devicestruc>>(name)->size(); ++i) {
7141  if(!p[name][i].is_null()) {
7142  get_pointer<vector<devicestruc>>(name)->at(i).from_json(p[name][i].dump());
7143  }
7144  }
7145  } else if (type == "vector<equationstruc>") {
7146  for(size_t i = 0; i < get_pointer<vector<equationstruc>>(name)->size(); ++i) {
7147  if(!p[name][i].is_null()) {
7148  get_pointer<vector<equationstruc>>(name)->at(i).from_json(p[name][i].dump());
7149  }
7150  }
7151  } else if (type == "vector<eventstruc>") {
7152  for(size_t i = 0; i < get_pointer<vector<eventstruc>>(name)->size(); ++i) {
7153  if(!p[name][i].is_null()) {
7154  get_pointer<vector<eventstruc>>(name)->at(i).from_json(p[name][i].dump());
7155  }
7156  }
7157  } else if (type == "vector<face>") {
7158  for(size_t i = 0; i < get_pointer<vector<Cosmos::wavefront::face>>(name)->size(); ++i) {
7159  if(!p[name][i].is_null()) {
7160  get_pointer<vector<Cosmos::wavefront::face>>(name)->at(i).from_json(p[name][i].dump());
7161  }
7162  }
7163  } else if (type == "vector<facestruc>") {
7164  for(size_t i = 0; i < get_pointer<vector<facestruc>>(name)->size(); ++i) {
7165  if(!p[name][i].is_null()) {
7166  get_pointer<vector<facestruc>>(name)->at(i).from_json(p[name][i].dump());
7167  }
7168  }
7169  } else if (type == "vector<group>") {
7170  for(size_t i = 0; i < get_pointer<vector<Cosmos::wavefront::group>>(name)->size(); ++i) {
7171  if(!p[name][i].is_null()) {
7172  get_pointer<vector<Cosmos::wavefront::group>>(name)->at(i).from_json(p[name][i].dump());
7173  }
7174  }
7175  } else if (type == "vector<line>") {
7176  for(size_t i = 0; i < get_pointer<vector<Cosmos::wavefront::line>>(name)->size(); ++i) {
7177  if(!p[name][i].is_null()) {
7178  get_pointer<vector<Cosmos::wavefront::line>>(name)->at(i).from_json(p[name][i].dump());
7179  }
7180  }
7181  } else if (type == "vector<material>") {
7182  for(size_t i = 0; i < get_pointer<vector<Cosmos::wavefront::material>>(name)->size(); ++i) {
7183  if(!p[name][i].is_null()) {
7184  get_pointer<vector<Cosmos::wavefront::material>>(name)->at(i).from_json(p[name][i].dump());
7185  }
7186  }
7187  } else if (type == "vector<piecestruc>") {
7188  for(size_t i = 0; i < get_pointer<vector<piecestruc>>(name)->size(); ++i) {
7189  if(!p[name][i].is_null()) {
7190  get_pointer<vector<piecestruc>>(name)->at(i).from_json(p[name][i].dump());
7191  }
7192  }
7193  } else if (type == "vector<point>") {
7194  for(size_t i = 0; i < get_pointer<vector<Cosmos::wavefront::point>>(name)->size(); ++i) {
7195  if(!p[name][i].is_null()) {
7196  get_pointer<vector<Cosmos::wavefront::point>>(name)->at(i).from_json(p[name][i].dump());
7197  }
7198  }
7199  } else if (type == "vector<portstruc>") {
7200  for(size_t i = 0; i < get_pointer<vector<portstruc>>(name)->size(); ++i) {
7201  if(!p[name][i].is_null()) {
7202  get_pointer<vector<portstruc>>(name)->at(i).from_json(p[name][i].dump());
7203  }
7204  }
7205  } else if (type == "vector<targetstruc>") {
7206  for(size_t i = 0; i < get_pointer<vector<targetstruc>>(name)->size(); ++i) {
7207  if(!p[name][i].is_null()) {
7208  get_pointer<vector<targetstruc>>(name)->at(i).from_json(p[name][i].dump());
7209  }
7210  }
7211  } else if (type == "vector<tlestruc>") {
7212  for(size_t i = 0; i < get_pointer<vector<tlestruc>>(name)->size(); ++i) {
7213  if(!p[name][i].is_null()) {
7214  get_pointer<vector<tlestruc>>(name)->at(i).from_json(p[name][i].dump());
7215  }
7216  }
7217  } else if (type == "vector<trianglestruc>") {
7218  for(size_t i = 0; i < get_pointer<vector<trianglestruc>>(name)->size(); ++i) {
7219  if(!p[name][i].is_null()) {
7220  get_pointer<vector<trianglestruc>>(name)->at(i).from_json(p[name][i].dump());
7221  }
7222  }
7223  } else if (type == "vector<unitstruc>") {
7224  for(size_t i = 0; i < get_pointer<vector<unitstruc>>(name)->size(); ++i) {
7225  if(!p[name][i].is_null()) {
7226  get_pointer<vector<unitstruc>>(name)->at(i).from_json(p[name][i].dump());
7227  }
7228  }
7229  } else if (type == "vector<userstruc>") {
7230  for(size_t i = 0; i < get_pointer<vector<userstruc>>(name)->size(); ++i) {
7231  if(!p[name][i].is_null()) {
7232  get_pointer<vector<userstruc>>(name)->at(i).from_json(p[name][i].dump());
7233  }
7234  }
7235  } else if (type == "vector<Vector>") {
7236  for(size_t i = 0; i < get_pointer<vector<Vector>>(name)->size(); ++i) {
7237  if(!p[name][i].is_null()) {
7238  get_pointer<vector<Vector>>(name)->at(i).from_json(p[name][i].dump());
7239  }
7240  }
7241  } else if (type == "vector<unitstruc>") {
7242  for(size_t i = 0; i < get_pointer<vector<unitstruc>>(name)->size(); ++i) {
7243  if(!p[name][i].is_null()) {
7244  get_pointer<vector<unitstruc>>(name)->at(i).from_json(p[name][i].dump());
7245  }
7246  }
7247  } else if (type == "vector<vector<unitstruc>>") {
7248  for(size_t i = 0; i < get_pointer<vector<vector<unitstruc>>>(name)->size(); ++i) {
7249  for(size_t j = 0; j < get_pointer<vector<vector<unitstruc>>>(name)->at(i).size(); ++j) {
7250  if(!p[name][i][j].is_null()) {
7251  get_pointer<vector<vector<unitstruc>>>(name)->at(i).at(j).from_json(p[name][i][j].dump());
7252  }
7253  }
7254  }
7255  } else if (type == "vector<vertexstruc>") {
7256  for(size_t i = 0; i < get_pointer<vector<vertexstruc>>(name)->size(); ++i) {
7257  if(!p[name][i].is_null()) {
7258  get_pointer<vector<vertexstruc>>(name)->at(i).from_json(p[name][i].dump());
7259  }
7260  }
7261  } else {
7262  // I guess this block means the type is not supported!
7263  // could re-add templated version of set_json so user
7264  // can explicitly call for given unsupported datatype
7265  //get_pointer<T>(name)->from_json(json);
7266  return;
7267  }
7268  }
7269  }
7270  }
7271  }// end for loop
7272  }
7273 
7275 
7280  template<class T>
7281  string get_json(const string& s) {
7282  if(name_exists(s)) {
7283  json11::Json json = json11::Json::object { { s, this->get_value<T>(s) } };
7284  return json.dump();
7285  } else {
7286  return "";
7287  }
7288  }
7289 
7290  // get called from agents (no template)
7292 
7297  string get_json(const string& s) {
7298  if(name_exists(s)) {
7299  json11::Json json;
7300  string type = get_type(s);
7301  // base data types
7302  if (type == "uint32_t") {
7303  json = json11::Json::object { { s, get_value<int>(s) } };
7304  } else if (type == "int32_t") {
7305  json = json11::Json::object { { s, get_value<int32_t>(s) } };
7306  } else if (type == "uint16_t") {
7307  json = json11::Json::object { { s, get_value<uint16_t>(s) } };
7308  } else if (type == "int16_t") {
7309  json = json11::Json::object { { s, get_value<int16_t>(s) } };
7310  } else if (type == "uint8_t") {
7311  json = json11::Json::object { { s, get_value<uint8_t>(s) } };
7312  } else if (type == "int8_t") {
7313  json = json11::Json::object { { s, get_value<int8_t>(s) } };
7314  } else if (type == "int") {
7315  json = json11::Json::object { { s, get_value<int>(s) } };
7316  } else if (type == "size_t") {
7317  json = json11::Json::object { { s, get_value<int>(s) } };
7318  } else if (type == "bool") {
7319  json = json11::Json::object { { s, get_value<bool>(s) } };
7320  } else if (type == "string") {
7321  json = json11::Json::object { { s, get_value<string>(s) } };
7322  } else if (type == "float") {
7323  json = json11::Json::object { { s, get_value<float>(s) } };
7324  } else if (type == "double") {
7325  json = json11::Json::object { { s, get_value<double>(s) } };
7326 
7327  // user-defined types
7328  } else if (type == "agent_request_entry") {
7329  // json = json11::Json::object { { s, get_value<agent_request_entry>(s) } };
7330  } else if (type == "agentstruc") {
7331  json = json11::Json::object { { s, get_value<agentstruc>(s) } };
7332  } else if (type == "attstruc") {
7333  json = json11::Json::object { { s, get_value<attstruc>(s) } };
7334  } else if (type == "beatstruc") {
7335  json = json11::Json::object { { s, get_value<beatstruc>(s) } };
7336  } else if (type == "cartpos") {
7337  json = json11::Json::object { { s, get_value<cartpos>(s) } };
7338  } else if (type == "cosmosstruc") {
7339  json = json11::Json::object { { s, get_value<cosmosstruc>(s) } };
7340  } else if (type == "cvector") {
7341  json = json11::Json::object { { s, get_value<cvector>(s) } };
7342  } else if (type == "devicestruc") {
7343  json = json11::Json::object { { s, get_value<devicestruc>(s) } };
7344  } else if (type == "devspecstruc") {
7345  json = json11::Json::object { { s, get_value<devspecstruc>(s) } };
7346  } else if (type == "equationstruc") {
7347  json = json11::Json::object { { s, get_value<equationstruc>(s) } };
7348  } else if (type == "eventstruc") {
7349  json = json11::Json::object { { s, get_value<eventstruc>(s) } };
7350  } else if (type == "extraatt") {
7351  json = json11::Json::object { { s, get_value<extraatt>(s) } };
7352  } else if (type == "extrapos") {
7353  json = json11::Json::object { { s, get_value<extrapos>(s) } };
7354  } else if (type == "face") {
7355  json = json11::Json::object { { s, get_value<Cosmos::wavefront::face>(s) } };
7356  } else if (type == "facestruc") {
7357  json = json11::Json::object { { s, get_value<facestruc>(s) } };
7358  } else if (type == "geoidpos") {
7359  json = json11::Json::object { { s, get_value<geoidpos>(s) } };
7360  } else if (type == "group") {
7361  json = json11::Json::object { { s, get_value<Cosmos::wavefront::group>(s) } };
7362  } else if (type == "gvector") {
7363  json = json11::Json::object { { s, get_value<gvector>(s) } };
7364  } else if (type == "line") {
7365  json = json11::Json::object { { s, get_value<Cosmos::wavefront::line>(s) } };
7366  } else if (type == "jsonhandle") {
7367  json = json11::Json::object { { s, get_value<jsonhandle>(s) } };
7368  } else if (type == "jsonnode") {
7369  json = json11::Json::object { { s, get_value<jsonnode>(s) } };
7370  } else if (type == "locstruc") {
7371  json = json11::Json::object { { s, get_value<locstruc>(s) } };
7372  } else if (type == "material") {
7373  json = json11::Json::object { { s, get_value<Cosmos::wavefront::material>(s) } };
7374  } else if (type == "NetworkType") {
7375  // json = json11::Json::object { { s, get_value<NetworkType>(s) } };
7376  } else if (type == "nodestruc") {
7377  json = json11::Json::object { { s, get_value<nodestruc>(s) } };
7378  } else if (type == "piecestruc") {
7379  json = json11::Json::object { { s, get_value<piecestruc>(s) } };
7380  } else if (type == "physicsstruc") {
7381  json = json11::Json::object { { s, get_value<physicsstruc>(s) } };
7382  } else if (type == "point") {
7383  json = json11::Json::object { { s, get_value<Cosmos::wavefront::point>(s) } };
7384  } else if (type == "portstruc") {
7385  json = json11::Json::object { { s, get_value<portstruc>(s) } };
7386  } else if (type == "PORT_TYPE") {
7387  json = json11::Json::object { { s, get_value<PORT_TYPE>(s) } };
7388  } else if (type == "posstruc") {
7389  json = json11::Json::object { { s, get_value<posstruc>(s) } };
7390  } else if (type == "qatt") {
7391  json = json11::Json::object { { s, get_value<qatt>(s) } };
7392  } else if (type == "quaternion") {
7393  json = json11::Json::object { { s, get_value<quaternion>(s) } };
7394  } else if (type == "rmatrix") {
7395  json = json11::Json::object { { s, get_value<rmatrix>(s) } };
7396  } else if (type == "rvector") {
7397  json = json11::Json::object { { s, get_value<rvector>(s) } };
7398  } else if (type == "rvector[]") {
7399  // json = json11::Json::object { { s, get_value<rvector[]>(s) } };
7400  } else if (type == "socket_channel") {
7401  // json = json11::Json::object { { s, get_value<socket_channel>(s) } };
7402  } else if (type == "socket_channel[]") {
7403  // json = json11::Json::object { { s, get_value<socket_channel[]>(s) } };
7404  } else if (type == "spherpos") {
7405  json = json11::Json::object { { s, get_value<spherpos>(s) } };
7406  } else if (type == "svector") {
7407  json = json11::Json::object { { s, get_value<svector>(s) } };
7408  } else if (type == "targetstruc") {
7409  json = json11::Json::object { { s, get_value<targetstruc>(s) } };
7410  } else if (type == "tlestruc") {
7411  json = json11::Json::object { { s, get_value<tlestruc>(s) } };
7412  } else if (type == "trianglestruc") {
7413  json = json11::Json::object { { s, get_value<trianglestruc>(s) } };
7414  } else if (type == "unitstruc") {
7415  json = json11::Json::object { { s, get_value<unitstruc>(s) } };
7416  } else if (type == "userstruc") {
7417  json = json11::Json::object { { s, get_value<userstruc>(s) } };
7418  } else if (type == "Vector") {
7419  json = json11::Json::object { { s, get_value<Vector>(s) } };
7420  } else if (type == "vertexstruc") {
7421  json = json11::Json::object { { s, get_value<vertexstruc>(s) } };
7422  } else if (type == "wavefront") {
7423  json = json11::Json::object { { s, get_value<wavefront>(s) } };
7424 
7425  // vector of primitives
7426  } else if (type == "vector<uint32_t>") {
7427  json = json11::Json::object { { s, get_value<vector<int>>(s) } };
7428  } else if (type == "vector<vector<uint32_t>>") {
7429  json = json11::Json::object { { s, get_value<vector<vector<int>>>(s) } };
7430  } else if (type == "vector<int32_t>") {
7431  json = json11::Json::object { { s, get_value<vector<int32_t>>(s) } };
7432  } else if (type == "vector<vector<int32_t>>") {
7433  json = json11::Json::object { { s, get_value<vector<vector<int32_t>>>(s) } };
7434  } else if (type == "vector<uint16_t>") {
7435  json = json11::Json::object { { s, get_value<vector<uint16_t>>(s) } };
7436  } else if (type == "vector<vector<uint16_t>>") {
7437  json = json11::Json::object { { s, get_value<vector<vector<uint16_t>>>(s) } };
7438  } else if (type == "vector<int16_t>") {
7439  json = json11::Json::object { { s, get_value<vector<int16_t>>(s) } };
7440  } else if (type == "vector<vector<int16_t>>") {
7441  json = json11::Json::object { { s, get_value<vector<vector<int16_t>>>(s) } };
7442  } else if (type == "vector<uint8_t>") {
7443  json = json11::Json::object { { s, get_value<vector<uint8_t>>(s) } };
7444  } else if (type == "vector<vector<uint8_t>>") {
7445  json = json11::Json::object { { s, get_value<vector<vector<uint8_t>>>(s) } };
7446  } else if (type == "vector<int8_t>") {
7447  json = json11::Json::object { { s, get_value<vector<int8_t>>(s) } };
7448  } else if (type == "vector<vector<int8_t>>") {
7449  json = json11::Json::object { { s, get_value<vector<vector<int8_t>>>(s) } };
7450  } else if (type == "vector<int>") {
7451  json = json11::Json::object { { s, get_value<vector<int>>(s) } };
7452  } else if (type == "vector<vector<int>>") {
7453  json = json11::Json::object { { s, get_value<vector<vector<int>>>(s) } };
7454  } else if (type == "vector<size_t>") {
7455  json = json11::Json::object { { s, get_value<vector<int>>(s) } };
7456  } else if (type == "vector<vector<size_t>>") {
7457  json = json11::Json::object { { s, get_value<vector<vector<int>>>(s) } };
7458  } else if (type == "vector<bool>") {
7459  json = json11::Json::object { { s, get_value<vector<bool>>(s) } };
7460  } else if (type == "vector<vector<bool>>") {
7461  json = json11::Json::object { { s, get_value<vector<vector<bool>>>(s) } };
7462  } else if (type == "vector<string>") {
7463  json = json11::Json::object { { s, get_value<vector<string>>(s) } };
7464  } else if (type == "vector<vector<string>>") {
7465  json = json11::Json::object { { s, get_value<vector<vector<string>>>(s) } };
7466  } else if (type == "vector<float>") {
7467  json = json11::Json::object { { s, get_value<vector<float>>(s) } };
7468  } else if (type == "vector<vector<float>>") {
7469  json = json11::Json::object { { s, get_value<vector<vector<float>>>(s) } };
7470  } else if (type == "vector<double>") {
7471  json = json11::Json::object { { s, get_value<vector<double>>(s) } };
7472  } else if (type == "vector<vector<double>>") {
7473  json = json11::Json::object { { s, get_value<vector<vector<double>>>(s) } };
7474 
7475  // vector of user-defined types
7476  } else if (type == "vector<agent_request_entry>") {
7477  // json = json11::Json::object { { s, get_value<vector<agent_request_entry>>(s) } };
7478  } else if (type == "vector<agentstruc>") {
7479  json = json11::Json::object { { s, get_value<vector<agentstruc>>(s) } };
7480  } else if (type == "vector<devicestruc>") {
7481  json = json11::Json::object { { s, get_value<vector<devicestruc>>(s) } };
7482  } else if (type == "vector<equationstruc>") {
7483  json = json11::Json::object { { s, get_value<vector<equationstruc>>(s) } };
7484  } else if (type == "vector<eventstruc>") {
7485  json = json11::Json::object { { s, get_value<vector<eventstruc>>(s) } };
7486  } else if (type == "vector<face>") {
7487  json = json11::Json::object { { s, get_value<vector<Cosmos::wavefront::face>>(s) } };
7488  } else if (type == "vector<facestruc>") {
7489  json = json11::Json::object { { s, get_value<vector<facestruc>>(s) } };
7490  } else if (type == "vector<group>") {
7491  json = json11::Json::object { { s, get_value<vector<Cosmos::wavefront::group>>(s) } };
7492  } else if (type == "vector<line>") {
7493  json = json11::Json::object { { s, get_value<vector<Cosmos::wavefront::line>>(s) } };
7494  } else if (type == "vector<material>") {
7495  json = json11::Json::object { { s, get_value<vector<Cosmos::wavefront::material>>(s) } };
7496  } else if (type == "vector<piecestruc>") {
7497  json = json11::Json::object { { s, get_value<vector<piecestruc>>(s) } };
7498  } else if (type == "vector<point>") {
7499  json = json11::Json::object { { s, get_value<vector<Cosmos::wavefront::point>>(s) } };
7500  } else if (type == "vector<portstruc>") {
7501  json = json11::Json::object { { s, get_value<vector<portstruc>>(s) } };
7502  } else if (type == "vector<targetstruc>") {
7503  json = json11::Json::object { { s, get_value<vector<targetstruc>>(s) } };
7504  } else if (type == "vector<tlestruc>") {
7505  json = json11::Json::object { { s, get_value<vector<tlestruc>>(s) } };
7506  } else if (type == "vector<trianglestruc>") {
7507  json = json11::Json::object { { s, get_value<vector<trianglestruc>>(s) } };
7508  } else if (type == "vector<unitstruc>") {
7509  json = json11::Json::object { { s, get_value<vector<unitstruc>>(s) } };
7510  } else if (type == "vector<userstruc>") {
7511  json = json11::Json::object { { s, get_value<vector<userstruc>>(s) } };
7512  } else if (type == "vector<Vector>") {
7513  json = json11::Json::object { { s, get_value<vector<Vector>>(s) } };
7514  } else if (type == "vector<vector<unitstruc>>") {
7515  json = json11::Json::object { { s, get_value<vector<vector<unitstruc>>>(s) } };
7516  } else if (type == "vector<vertexstruc>") {
7517  json = json11::Json::object { { s, get_value<vector<vertexstruc>>(s) } };
7518  }
7519  return json.dump();
7520  } else {
7521  return "";
7522  }
7523  }
7524 
7526 
7533  void replace(std::string& str, const std::string& from, const std::string& to) {
7534  if(from.empty()) return;
7535  size_t start_pos = 0;
7536  while((start_pos = str.find(from, start_pos)) != std::string::npos) {
7537  str.replace(start_pos, from.length(), to);
7538  start_pos += to.length();
7539  }
7540  return;
7541  }
7542 
7544 
7549  void pretty_form(string& js) {
7550 
7551 // JIMNOTE: fix bug with splitting lines over array indices [#]
7552 
7553  replace(js, ", ", ",\n");
7554  replace(js, "[]", "E M P T Y V E C T O R");
7555  replace(js, "{}", "E M P T Y O B J E C T");
7556  replace(js, "{", "{\n");
7557  replace(js, "[", "[\n");
7558  replace(js, "}", "\n}");
7559  replace(js, "]", "\n]");
7560  replace(js, "E M P T Y O B J E C T", "{}");
7561  replace(js, "E M P T Y V E C T O R", "[]");
7562 
7563  // create vector[char position] = # of indents
7564  int indent = 0;
7565  vector<size_t> indents;
7566  for(size_t i = 0; i < js.size(); ++i) {
7567  if(js[i]=='['){ ++indent;}
7568  if(js[i]=='{'){ ++indent;}
7569  if(js[i]==']'){ --indent; indents[i-1]--;}
7570  if(js[i]=='}'){ --indent; indents[i-1]--;}
7571  indents.push_back(indent);
7572  }
7573 
7574  // find position of all '\n' characters
7575  vector<size_t> newlines;
7576  for(size_t i =0; i < js.size(); i++) if(js[i] == '\n') newlines.push_back(i);
7577 
7578  // insert the appropriate # of indents after the '\n' char
7579  for(size_t i = newlines.size(); i!=0; ) {
7580  --i;
7581  string indent_string;
7582  for(size_t j = 0; j < indents[newlines[i]]; ++j) indent_string += " ";
7583  js.insert(newlines[i]+1, indent_string);
7584  }
7585  return;
7586  }
7587 
7588  template<class T>
7589  string get_json_pretty(const string& s) {
7590  if(name_exists(s)) {
7591  json11::Json json = json11::Json::object { { s, this->get_value<T>(s) } };
7592  string pretty = json.dump();
7593  pretty_form(pretty);
7594  return pretty;
7595  } else {
7596  return "";
7597  }
7598  }
7599 
7600 
7602 
7606  return json11::Json::object {
7607  { "timestamp" , timestamp },
7608  { "jmapped" , jmapped },
7609  { "unit" , unit },
7610  { "equation" , equation },
7611  { "node" , node },
7612  { "vertexs" , vertexs },
7613  { "normals" , normals },
7614  { "faces" , faces },
7615  { "pieces" , pieces },
7616  { "obj" , obj },
7617  { "device" , device },
7618  { "devspec" , devspec },
7619  { "port" , port },
7620  { "agent" , agent },
7621  { "event" , event },
7622  { "target" , target },
7623  { "user" , user },
7624  { "tle" , tle },
7625  //{ "json" , json }
7626  };
7627  }
7628 
7630 
7635  void from_json(const string& s) {
7636  string error;
7637  json11::Json p = json11::Json::parse(s,error);
7638  if(error.empty()) {
7639  string obj(p.object_items().begin()->first); // NOTE: Should we rename this to something else? We already have a wavefront obj member var
7640  if (!p[obj]["timestamp"].is_null()) { timestamp = p[obj]["timestamp"].number_value(); }
7641  if (!p[obj]["jmapped"].is_null()) { jmapped = p[obj]["jmapped"].number_value(); }
7642  for (size_t i = 0; i < unit.size(); ++i) {
7643  for (size_t j = 0; j < unit[i].size(); ++j) {
7644  if (!p[obj]["unit"][i][j].is_null()) { unit[i][j].from_json(p[obj]["unit"][i][j].dump()); }
7645  }
7646  }
7647  for (size_t i = 0; i < equation.size(); ++i) {
7648  if (!p[obj]["equation"][i].is_null()) { equation[i].from_json(p[obj]["equation"][i].dump()); }
7649  }
7650  if (!p[obj]["node"].is_null()) { node.from_json(p[obj]["node"].dump()); }
7651  for (size_t i = 0; i < vertexs.size(); ++i) {
7652  if (!p[obj]["vertexs"][i].is_null()) { vertexs[i].from_json(p[obj]["vertexs"][i].dump()); }
7653  }
7654  for (size_t i = 0; i < normals.size(); ++i) {
7655  if (!p[obj]["normals"][i].is_null()) { normals[i].from_json(p[obj]["normals"][i].dump()); }
7656  }
7657  for (size_t i = 0; i < faces.size(); ++i) {
7658  if (!p[obj]["faces"][i].is_null()) { faces[i].from_json(p[obj]["faces"][i].dump()); }
7659  }
7660  if (!p["obj"].is_null()) { cosmosstruc::obj.from_json(p[obj]["obj"].dump()); }
7661  for (size_t i = 0; i < device.size(); ++i) {
7662  if (!p[obj]["device"][i].is_null()) { device[i].from_json(p[obj]["device"][i].dump()); }
7663  }
7664  if (!p[obj]["devspec"].is_null()) { devspec.from_json(p[obj]["devspec"].dump()); }
7665  for (size_t i = 0; i < port.size(); ++i) {
7666  if (!p[obj]["port"][i].is_null()) { port[i].from_json(p[obj]["port"][i].dump()); }
7667  }
7668  for (size_t i = 0; i < agent.size(); ++i) {
7669  if (!p[obj]["agent"][i].is_null()) { agent[i].from_json(p[obj]["agent"][i].dump()); }
7670  }
7671  for (size_t i = 0; i < event.size(); ++i) {
7672  if (!p[obj]["event"][i].is_null()) { event[i].from_json(p[obj]["event"][i].dump()); }
7673  }
7674  for (size_t i = 0; i < target.size(); ++i) {
7675  if (!p[obj]["target"][i].is_null()) { target[i].from_json(p[obj]["target"][i].dump()); }
7676  }
7677  for (size_t i = 0; i < user.size(); ++i) {
7678  if (!p[obj]["user"][i].is_null()) { user[i].from_json(p[obj]["user"][i].dump()); }
7679  }
7680  for (size_t i = 0; i < tle.size(); ++i) {
7681  if (!p[obj]["tle"][i].is_null()) { tle[i].from_json(p[obj]["tle"][i].dump()); }
7682  }
7683  //if(!p[obj]["json"].is_null()) json.from_json(p[obj]["json"].dump());
7684  } else {
7685  cerr<<"ERROR: <"<<error<<">"<<endl;
7686  }
7687  return;
7688  }
7689 
7691 
7696  bool left_ass(char a) {
7697  if(a == '+') return true;
7698  if(a == '-') return true;
7699  if(a == '*') return true;
7700  if(a == '/') return true;
7701  if(a == '^') return false;
7702 
7703  return false;
7704  }
7705 
7707 
7713  bool equal_ass(char a, char b) {
7714  if(a == '+' && b == '+') return true;
7715  if(a == '+' && b == '-') return true;
7716  if(a == '+' && b == '*') return false;
7717  if(a == '+' && b == '/') return false;
7718  if(a == '+' && b == '^') return false;
7719 
7720  if(a == '-' && b == '+') return true;
7721  if(a == '-' && b == '-') return true;
7722  if(a == '-' && b == '*') return false;
7723  if(a == '-' && b == '/') return false;
7724  if(a == '-' && b == '^') return false;
7725 
7726  if(a == '*' && b == '+') return false;
7727  if(a == '*' && b == '-') return false;
7728  if(a == '*' && b == '*') return true;
7729  if(a == '*' && b == '/') return true;
7730  if(a == '*' && b == '^') return false;
7731 
7732  if(a == '/' && b == '+') return false;
7733  if(a == '/' && b == '-') return false;
7734  if(a == '/' && b == '*') return true;
7735  if(a == '/' && b == '/') return true;
7736  if(a == '/' && b == '^') return false;
7737 
7738  if(a == '^' && b == '+') return false;
7739  if(a == '^' && b == '-') return false;
7740  if(a == '^' && b == '*') return false;
7741  if(a == '^' && b == '/') return false;
7742  if(a == '^' && b == '^') return true;
7743 
7744  return false;
7745  }
7746 
7748 
7754  bool higher(char a, char b) {
7755 
7756  if(a == '+' && b == '+') return false;
7757  if(a == '+' && b == '-') return false;
7758  if(a == '+' && b == '*') return false;
7759  if(a == '+' && b == '/') return false;
7760  if(a == '+' && b == '^') return false;
7761 
7762  if(a == '-' && b == '+') return false;
7763  if(a == '-' && b == '-') return false;
7764  if(a == '-' && b == '*') return false;
7765  if(a == '-' && b == '/') return false;
7766  if(a == '-' && b == '^') return false;
7767 
7768  if(a == '*' && b == '+') return true;
7769  if(a == '*' && b == '-') return true;
7770  if(a == '*' && b == '*') return false;
7771  if(a == '*' && b == '/') return false;
7772  if(a == '*' && b == '^') return false;
7773 
7774  if(a == '/' && b == '+') return true;
7775  if(a == '/' && b == '-') return true;
7776  if(a == '/' && b == '*') return false;
7777  if(a == '/' && b == '/') return false;
7778  if(a == '/' && b == '^') return false;
7779 
7780  if(a == '^' && b == '+') return true;
7781  if(a == '^' && b == '-') return true;
7782  if(a == '^' && b == '*') return true;
7783  if(a == '^' && b == '/') return true;
7784  if(a == '^' && b == '^') return false;
7785 
7786  return false;
7787  }
7788 
7790 
7796  int apply_op(stack<char>& ops, stack<double>& answer) {
7797  if(answer.size()<2) return -1;
7798  double b = answer.top();
7799  answer.pop();
7800  double a = answer.top();
7801  answer.pop();
7802  switch(ops.top()) {
7803  case '+': answer.push(a+b);
7804  break;
7805  case '-': answer.push(a-b);
7806  break;
7807  case '*': answer.push(a*b);
7808  break;
7809  case '/': answer.push(a/b);
7810  break;
7811  case '^': answer.push(pow(a,b));
7812  break;
7813  }
7814  //cout<<" calculating "<<a<<" "<<ops.top()<<" "<<b<<" = "<<answer.top()<<endl;
7815  ops.pop();
7816  return 0;
7817  }
7818 
7820 
7825  double equationator(const string& str) {
7826  string eq(str);
7827 
7828  // START EQUATION PRE-PROCESSING
7829 
7830  // check if empty
7831  if(eq.empty()) return nan("");
7832 
7833  // check if double quotes are balanced
7834  int q_count = 0;
7835  for(std::string::const_iterator it = eq.begin(); it != eq.end(); ++it) {
7836  if(*it=='"') q_count++;
7837  }
7838  if(q_count%2==1) return nan("");
7839 
7840  // TODO: you should never have #( or )#... implied multiplication, but make explicit already!
7841 
7842  // trim leading whitespace
7843  const auto notwhite = eq.find_first_not_of(" \n\r\t\f\v");
7844  eq = eq.substr(notwhite);
7845 
7846  // replace "cosmos_variable_names" with values
7847  vector<string> replacements;
7848  for(size_t i = 0; i < eq.size(); ++i) {
7849  //cout<<"char = <"<<eq[i]<<">"<<endl;
7850  if(eq[i]=='"') {
7851  string name("");
7852  //cout<<"found opening quote"<<endl;
7853  while(eq[++i]!='"'&&i<eq.size()) { name.push_back(eq[i]); }
7854  //cout<<"name = "<<name<<endl;
7855  replacements.push_back(name);
7856  }
7857  }
7858 
7859  for(size_t i = 0; i < replacements.size(); ++i) {
7860  string replace_me = "\"" + replacements[i] + "\"";
7861  string type = get_type(replacements[i]);
7862  if(type=="double") {
7863  replace(eq, replace_me, to_string(get_value<double>(replacements[i])));
7864  } else if(type=="float") {
7865  replace(eq, replace_me, to_string(get_value<float>(replacements[i])));
7866  } else if(type=="size_t") {
7867  replace(eq, replace_me, to_string(get_value<size_t>(replacements[i])));
7868  } else if(type=="int") {
7869  replace(eq, replace_me, to_string(get_value<int>(replacements[i])));
7870  } else if(type=="uint16_t") {
7871  replace(eq, replace_me, to_string(get_value<uint16_t>(replacements[i])));
7872  } else if(type=="int16_t") {
7873  replace(eq, replace_me, to_string(get_value<int16_t>(replacements[i])));
7874  } else if(type=="uint32_t") {
7875  replace(eq, replace_me, to_string(get_value<uint32_t>(replacements[i])));
7876  } else if(type=="int32_t") {
7877  replace(eq, replace_me, to_string(get_value<int32_t>(replacements[i])));
7878  } else if(type=="uint8_t") {
7879  replace(eq, replace_me, to_string(get_value<uint8_t>(replacements[i])));
7880  } else if(type=="int8_t") {
7881  replace(eq, replace_me, to_string(get_value<int8_t>(replacements[i])));
7882  } else if(type=="bool") {
7883  replace(eq, replace_me, to_string(get_value<bool>(replacements[i])));
7884  } else {
7885  cout<<"type <"<<type<<"> for <"<<replacements[i]<<"> not supported"<<endl;
7886  return nan("");
7887  }
7888  }
7889 
7890  // replace {}[] with ()
7891  replace(eq, "{", "(");
7892  replace(eq, "[", "(");
7893  replace(eq, "}", ")");
7894  replace(eq, "]", ")");
7895 
7896  // replace ÷,– with /,-
7897  replace(eq, "÷", "/");
7898  replace(eq, "–", "-");
7899 
7900  // check if parenthesis are balanced
7901  int p_count = 0;
7902  for(std::string::const_iterator it = eq.begin(); it != eq.end(); ++it) {
7903  if(*it=='(') p_count++;
7904  if(*it==')') p_count--;
7905  if(p_count<0) return nan("");
7906  }
7907  if(p_count!=0) return nan("");
7908 
7909 
7910  // START EQUATION PROCESSING
7911 
7912  string output;
7913  stack<double> answer;
7914  stack<char> ops;
7915 
7916  //int count = 0;
7917  for(std::string::const_iterator it = eq.begin(); it != eq.end(); ++it) {
7918  // debug
7919  // cout<<"char #"<<count++<<" = '"<<*it<<"' :\n\t<"<<output<<">"<<endl;
7920  // cout<<"\t: operators = <";
7921  // for(stack<char> op = ops; !op.empty(); op.pop()) { cout<<op.top()<<" "; }
7922  // cout<<">"<<endl;
7923 
7924  // all letters should have been replaced by values
7925  if(isalpha(*it)) return nan("");
7926  // skip all whitespace
7927  if(isspace(*it)) continue;
7928  // if token is number
7929  if(isdigit(*it)||*it=='.') {
7930  bool negative = false;
7931  if(*(it-1)=='+'||*(it-1)=='-') {
7932  string::const_iterator iit = it-1;
7933  if(iit==eq.begin()) {
7934  if(*(it-1)=='-') negative = true;
7935  ops.pop();
7936  } else {
7937  while(iit--!=eq.begin()) {
7938  if(isspace(*iit)) continue;
7939  if(*iit=='('||*iit=='+'||*iit=='-'||*iit=='*'||*iit=='/'||*iit=='^') {
7940  if(*(it-1)=='-') negative = true;
7941  ops.pop();
7942  break;
7943  } else {
7944  break;
7945  }
7946  }
7947  if(iit==eq.begin() && (*iit==' '||*iit=='\t'||*iit=='\n')) {
7948  if(*(it-1)=='-') negative = true;
7949  ops.pop();
7950  }
7951  }
7952  }
7953  vector<int> integer, fraction;
7954  if(isdigit(*it)) {
7955  integer.push_back(*it-'0');
7956  } else {
7957  integer.push_back(0); --it;
7958  }
7959  while(isdigit(*(it+1))) { integer.push_back(*(++it)-'0'); }
7960  if(*(it+1)=='.') { ++it; while(isdigit(*(it+1))) { fraction.push_back(*(++it)-'0'); } }
7961  double numnum = 0.;
7962  for(size_t i = 0; i < integer.size(); ++i) { numnum += integer[i]*1.0 * pow(10, integer.size()-i-1); }
7963  for(size_t i = 0; i < fraction.size(); ++i) { numnum += fraction[i]*1.0 * pow(10.0, -(i+1.0)); }
7964  if(negative) numnum *= -1.;
7965  stringstream ss;
7966  ss<<setprecision(std::numeric_limits<double>::digits10)<<numnum;
7967  output += ss.str() + " ";
7968  answer.push(numnum);
7969  continue;
7970  }
7971  // if token is operator
7972  if(*it=='+'||*it=='-'||*it=='*'||*it=='/'||*it=='^') {
7973  if((*it=='+'||*it=='-')&&(isdigit(*(it+1))||*(it+1)=='.')) {
7974  if(it==eq.begin()) { ops.push(*it); continue; }
7975  string::const_iterator t = it-1;
7976  while(t!=eq.begin() && (*t==' '||*t=='\n'||*t=='\t')) --t;
7977  if(*t=='+'||*t=='-'||*t=='*'||*t=='/'||*t=='^') {
7978  // only gently pushed, will be popped when negative number found
7979  ops.push(*it);
7980  continue;
7981  }
7982  }
7983  while( !ops.empty() &&
7984  ( higher(ops.top(), *it) || (equal_ass(ops.top(), *it) && left_ass(*it)) ) &&
7985  ops.top()!='('
7986  ) { output += string(1,(*it)) + " "; if(apply_op(ops, answer)<0) return nan(""); }
7987  ops.push(*it);
7988  } else if(*it == '(') {
7989  ops.push(*it);
7990  } else if(*it == ')') {
7991  while(ops.top()!='(') {
7992  output += string(1,(*it)) + " ";
7993  if(apply_op(ops, answer)<0) return nan("");
7994  }
7995  if(ops.top()=='(') { if(ops.empty()) return nan(""); else ops.pop(); }
7996  }
7997  }
7998  while(!ops.empty()) { output += string(1,ops.top()) + " "; if(apply_op(ops, answer)<0) return nan(""); }
7999  return answer.top();
8000  }
8001 
8002  // other namespace member functions??
8003  // maybe set_json for use with namespace names (calls from_json...)
8004 };
8005 
8007 
8008 #endif
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1781
rvector bearth
Earth magnetic vector in ITRS for this time and location.
Definition: convertdef.h:754
string get_type(const string &s) const
Gets the data type associated with the provided name in Namespace 2.0.
Definition: jsondef.h:6766
double y
Y value.
Definition: vector.h:114
Radio Receiver.
Definition: jsondef.h:508
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:742
Definition: jsondef.h:575
Definition: jsondef.h:650
int32_t cudp
Definition: jsondef.h:900
JSON 16 bit integer type.
Definition: jsondef.h:194
Definition: jsondef.h:284
Magnetic Torque Rod.
Definition: jsondef.h:500
uint16_t disk_cnt
Definition: jsondef.h:3868
rwstruc rw
Definition: jsondef.h:3713
Definition: jsondef.h:561
static string port
Definition: add_radio.cpp:16
Photo Voltaic String.
Definition: jsondef.h:514
uint16_t cport
Definition: jsondef.h:910
Fraction.
Definition: jsondef.h:135
quaternion align
Rotates vectors from RW frame (axis of rotation = z) to body frame.
Definition: jsondef.h:1923
Definition: jsondef.h:647
Vector moi
Definition: jsondef.h:3448
string get_json(const string &s)
Gets a JSON-formatted string of the data associated with the provided name in Namespace 2...
Definition: jsondef.h:7281
JSON rvector.
Definition: jsondef.h:210
float area
Definition: jsondef.h:3429
uint16_t target_cnt
Definition: jsondef.h:3575
Vector fdrag
Definition: jsondef.h:3444
vector< portstruc > port
Vector of all ports known to node.
Definition: jsondef.h:4244
svector s
Position vector.
Definition: convertdef.h:318
uint16_t agent_cnt
Definition: jsondef.h:3573
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2786
vector< group > Groups
Definition: objlib.h:328
int apply_op(stack< char > &ops, stack< double > &answer)
Applies an arithmetic operation between two values.
Definition: jsondef.h:7796
uint16_t imu_cnt
Definition: jsondef.h:3871
vector< uint16_t > mtr
Definition: jsondef.h:3907
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1821
std::map< std::string, Json > object
Definition: json11.hpp:88
pair< string, string > type_mapping
Definition: jsondef.h:4497
vector< facestruc > faces
Vector of all faces in node.
Definition: jsondef.h:4229
double utcstart
Definition: fast_contacts.cpp:64
Power.
Definition: jsondef.h:113
Vector twist
Contribution of triangle to angular forces.
Definition: jsondef.h:3286
int16_t powmode
Definition: jsondef.h:3580
vector< uint16_t > stt
Definition: jsondef.h:3916
JSON Timestamp.
Definition: jsondef.h:292
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2794
Magnetic Field Strengh.
Definition: jsondef.h:123
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2684
vector< tlestruc > tle
Array of Two Line Elements.
Definition: jsondef.h:4259
Definition: jsondef.h:585
uint16_t device_cnt
Definition: jsondef.h:3571
double utc
Definition: jsondef.h:837
void add_name(const string &s, void *v, string t)
Adds a name, memory location, and datatype to Namespace 2.0.
Definition: jsondef.h:4611
Motion Capture Camera (MCC) Structure.
Definition: jsondef.h:2985
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3458
bool higher(char a, char b)
Checks for higher operator precedence.
Definition: jsondef.h:7754
Definition: eci2kep_test.cpp:33
string get_json_pretty(const string &s)
Definition: jsondef.h:7589
rvector a
Definition: jsondef.h:2992
qatt geoc
Definition: convertdef.h:828
Definition: jsondef.h:290
Definition: json11.hpp:79
map< string, string > type_map
Definition: jsondef.h:4496
Charge.
Definition: jsondef.h:115
Definition: eci2kep_test.cpp:33
vector< uint16_t > prop
Definition: jsondef.h:3909
Device structure.
Definition: jsondef.h:3692
JSON string type.
Definition: jsondef.h:204
JSON Geocentric Attitude.
Definition: jsondef.h:264
Definition: jsondef.h:646
double orbit
Decimal Orbit number.
Definition: convertdef.h:756
piecestruc
Definition: jsondef.h:158
cartpos sun2earth
Definition: convertdef.h:605
quaternion q
attitude
Definition: jsondef.h:2990
Vector com
Definition: jsondef.h:3449
TNC Structure definition.
Definition: jsondef.h:3234
Frequency.
Definition: jsondef.h:103
rmatrix j2s
Definition: convertdef.h:598
A Namespace name.
Definition: jsondef.h:317
uint16_t msgsize
Definition: jsondef.h:912
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3040
Definition: eci2kep_test.cpp:33
Definition: jsondef.h:584
Definition: jsondef.h:923
uint16_t mcc_cnt
Definition: jsondef.h:3872
double utc
Definition: convertdef.h:261
rvector mag
Magnetic field in sensor frame.
Definition: jsondef.h:1873
double lambda
E/W in radians.
Definition: vector.h:172
uint16_t suchi_cnt
Definition: jsondef.h:3885
Bitwise OR #.
Definition: jsondef.h:354
y
Definition: inputfile.py:6
Vector gtorque
Definition: jsondef.h:3440
vector< uint16_t > bus
Definition: jsondef.h:3898
JSON 8 bit unsigned integer type.
Definition: jsondef.h:182
Force.
Definition: jsondef.h:105
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3259
Reaction Wheel.
Definition: jsondef.h:498
float radiation
Definition: jsondef.h:3428
Boolean And &.
Definition: jsondef.h:336
socket_channel req
Request channel (for Server)
Definition: jsondef.h:1019
ElapsedTime dt
Definition: agent_file3.cpp:183
Vector adrag
Definition: jsondef.h:3445
Heater.
Definition: jsondef.h:518
vector< uint16_t > gps
Definition: jsondef.h:3902
Antenna information.
Definition: jsondef.h:2251
vector< Vector > vertices
Definition: jsondef.h:3451
jsonhandle handle
Definition: jsondef.h:835
int addrlen
Definition: jsondef.h:908
Target structure.
Definition: jsondef.h:1290
devspecstruc
Definition: jsondef.h:152
PORT_TYPE
Definition: jsondef.h:644
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2027
Electrical Resistance.
Definition: jsondef.h:121
3 element generic row vector
Definition: vector.h:53
spherpos geos
Definition: convertdef.h:743
void set_PQW(double time)
Definition: jsondef.h:4425
rvector a
Acceleration.
Definition: convertdef.h:167
vector< uint16_t > rxr
Definition: jsondef.h:3914
double utc
UTC of Position.
Definition: convertdef.h:161
static float band
Definition: add_radio.cpp:22
uint16_t tsen_cnt
Definition: jsondef.h:3891
vector< material > Materials
Definition: objlib.h:324
int i
Definition: rw_test.cpp:37
userstruc
Definition: jsondef.h:162
Vector thrust
Definition: jsondef.h:3447
Motor.
Definition: jsondef.h:520
T get_value(const string &s) const
Gets the value of the data associated with the provided name in Namespace 2.0.
Definition: jsondef.h:6792
Definition: jsondef.h:599
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2352
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2893
cartpos selc
Definition: convertdef.h:740
float battcap
Definition: jsondef.h:3430
rvector dgeocs
Geocentric position error: x, y, z.
Definition: jsondef.h:2168
rvector a
2nd derivative: Alpha - acceleration
Definition: convertdef.h:483
void print_all_names() const
Prints every name within Namespace 2.0.
Definition: jsondef.h:4520
Telemetry.
Definition: jsondef.h:546
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2885
string devspec
Definition: jsondef.h:734
Elevation and Azimuth Sun Sensor.
Definition: jsondef.h:494
cvector d
Orientation.
Definition: vector.h:405
void remove_name_recursive(const string &s)
Removes names from Namespace 2.0 recursively.
Definition: jsondef.h:4634
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3152
Definition: jsondef.h:581
Definition: jsondef.h:653
Definition: jsondef.h:607
Definition: jsondef.h:566
uint16_t swch_cnt
Definition: jsondef.h:3886
tcustruc tcu
Definition: jsondef.h:3719
JSON Earth Centered Inertial Position.
Definition: jsondef.h:247
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:170
uint16_t type
JSON Operand Type.
Definition: jsondef.h:849
JSON qatt.
Definition: jsondef.h:232
void remove_name(const string &s)
Removes a name, memory location, and datatype from Namespace 2.0.
Definition: jsondef.h:4623
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1721
Definition: jsondef.h:592
Capacitance.
Definition: jsondef.h:119
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2565
JSON rmatrix.
Definition: jsondef.h:222
string synopsis
Definition: jsondef.h:889
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2767
quaternion align
alignment quaternion
Definition: jsondef.h:2937
string faces
Definition: jsondef.h:731
rmatrix dt2s
Definition: convertdef.h:604
Equation structure.
Definition: jsondef.h:1249
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:980
uint16_t normal_cnt
Definition: jsondef.h:3568
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:689
diskstruc disk
Definition: jsondef.h:3701
Not defined.
Definition: jsondef.h:298
uint16_t motr_cnt
Definition: jsondef.h:3873
uint16_t ssen_cnt
Definition: jsondef.h:3882
vector< vertexstruc > vertexs
Vector of all vertexs in node.
Definition: jsondef.h:4223
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2715
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2079
Quaternion, scalar last, using x, y, z.
Definition: vector.h:402
uint16_t event_cnt
Definition: jsondef.h:3574
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1058
float battlev
Definition: jsondef.h:3431
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2728
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:3167
rvector omega
Attitude rate vector.
Definition: jsondef.h:1869
JSON extrapos.
Definition: jsondef.h:230
Not a Component.
Definition: jsondef.h:556
rmatrix ddj2e
Definition: convertdef.h:592
string node
Definition: jsondef.h:727
Definition: jsondef.h:574
uint16_t bcreg_cnt
Definition: jsondef.h:3878
string to_string(char *value)
Definition: stringlib.cpp:220
txrstruc txr
Definition: jsondef.h:3725
rmatrix ds2t
Definition: convertdef.h:602
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1427
double y
Definition: vector.h:713
Magnetic FLux.
Definition: jsondef.h:125
T * get_pointer(const string &s) const
Gets the pointer to the memory address associated with the provided name in Namespace 2...
Definition: jsondef.h:6779
Definition: jsondef.h:576
vector< Vector > Vt
Definition: objlib.h:320
JSON cvector.
Definition: jsondef.h:214
uint16_t piece_cnt
Definition: jsondef.h:3570
float range
Definition: jsondef.h:3588
string name
Definition: jsondef.h:1252
Specific Impulse.
Definition: jsondef.h:131
BCREG.
Definition: jsondef.h:552
vector< uint16_t > htr
Definition: jsondef.h:3903
cartpos geoc
Definition: convertdef.h:739
JSON Lunar Centered Inertial Attitude.
Definition: jsondef.h:266
Vector ftorque
Definition: jsondef.h:3437
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3731
No units.
Definition: jsondef.h:65
char lastevent[40+1]
Last event.
Definition: jsondef.h:3558
float moonsep
Separation between sun/satellite and sun/limbofmoon vectors in radians.
Definition: convertdef.h:748
vector< uint16_t > imu
Definition: jsondef.h:3904
Battery (BATT) structure.
Definition: jsondef.h:2645
double utc
Master time for location, in Modified Julian Day.
Definition: convertdef.h:879
string output
Definition: agent-2-0.cpp:56
double utc
Overall Node time.
Definition: jsondef.h:3592
allstruc all
Definition: jsondef.h:3694
Switch Structure definition.
Definition: jsondef.h:2880
devicestruc
Definition: jsondef.h:150
Angle.
Definition: jsondef.h:95
Vector normal
Definition: jsondef.h:1404
wavefront obj
Definition: cubesat2obj.cpp:4
rvector o
Definition: jsondef.h:2991
facestruc
Definition: jsondef.h:172
vector< vector< jsonequation > > emap
JSON Equation Map matrix.
Definition: jsondef.h:4211
Vector material_diffuse
Material diffuse reflective qualities.
Definition: jsondef.h:1493
uint16_t tcv_cnt
Definition: jsondef.h:3888
Boolean Less Than <.
Definition: jsondef.h:342
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:903
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:311
uint16_t hash
Definition: jsondef.h:794
void add_default_names()
Add default names for every accessible memory location within the COSMOS Data Structure (cosmosstruc)...
Definition: jsondef.h:4671
Definition: jsondef.h:567
Definition: jsondef.h:579
Part structure: physical information for each piece of Node.
Definition: jsondef.h:1446
double x
X value.
Definition: vector.h:112
float earthsep
Separation between sun/satellite and sun/limbofearth vectors in radians.
Definition: convertdef.h:746
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:802
void replace(std::string &str, const std::string &from, const std::string &to)
Definition: agent_calc.cpp:126
Definition: jsondef.h:1199
Identity.
Definition: jsondef.h:54
Rotor.
Definition: jsondef.h:530
double tt
Terrestrial Time.
Definition: convertdef.h:584
Definition: jsondef.h:3072
double utc
Coordinated Universal Time.
Definition: convertdef.h:582
vector< uint16_t > ant
Definition: jsondef.h:3895
Subtraction -.
Definition: jsondef.h:328
Length.
Definition: jsondef.h:67
cartpos sun2moon
Definition: convertdef.h:606
suchistruc suchi
Definition: jsondef.h:3717
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2612
vector< uint16_t > rw
Definition: jsondef.h:3913
JSON Geocentric Spherical.
Definition: jsondef.h:257
quaternion align
Sensor alignment quaternion.
Definition: jsondef.h:1809
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2007
rvector alpha
Definition: jsondef.h:2941
JSON rvector.
Definition: jsondef.h:212
double mjddiff
Offset factor for simulated time (simtime = mjdaccel * realtime + mjddiff)
Definition: jsondef.h:3422
Temperature.
Definition: jsondef.h:79
vector< vector< unitstruc > > unit
JSON Unit Map matrix: first level is for unit type, second level is for all variants (starting with p...
Definition: jsondef.h:4214
uint16_t psen_cnt
Definition: jsondef.h:3877
Definition: jsondef.h:2741
Energy.
Definition: jsondef.h:111
JSON Geocentric Position.
Definition: jsondef.h:251
JSON attstruc.
Definition: jsondef.h:240
uint16_t pload_cnt
Definition: jsondef.h:3875
float sunradiance
Watts per square meter per steradian.
Definition: convertdef.h:752
Vector vertexstruc
Point structure: information on each vertex in a face.
Definition: jsondef.h:1396
Solid Angle.
Definition: jsondef.h:101
qatt lvlh
Definition: convertdef.h:827
long b
Definition: jpegint.h:371
Holder for number of entries (CLEVER!)
Definition: jsondef.h:137
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1501
uint16_t closest
Definition: convertdef.h:607
vector< vertexstruc > normals
Vector of all vertexs in node.
Definition: jsondef.h:4226
const string & str
Definition: json11.cpp:360
vector< uint16_t > txr
Definition: jsondef.h:3925
rmatrix t2s
Definition: convertdef.h:603
vector< uint16_t > pload
Definition: jsondef.h:3908
Polynomial.
Definition: jsondef.h:56
rvector v
1st derivative: Omega - angular velocity
Definition: convertdef.h:481
Physics Simulation Structure.
Definition: jsondef.h:3411
Angular rate.
Definition: jsondef.h:97
int32_t type
Definition: jsondef.h:898
double mjdaccel
Acceleration factor for simulated time.
Definition: jsondef.h:3420
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:3054
rotstruc rot
Definition: jsondef.h:3712
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:3093
quaternion align
Sensor alignment quaternion.
Definition: jsondef.h:2988
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3603
vector< point > Points
Definition: objlib.h:325
Definition: jsondef.h:173
Vector shove
Contribution of triangle to linear forces.
Definition: jsondef.h:3284
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1139
bool name_exists(const string &s)
Checks if provided name exists within Namespace 2.0.
Definition: jsondef.h:4508
vector< uint16_t > tcu
Definition: jsondef.h:3919
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1231
void print_all_names_types_values() const
Prints every name and the associated value and type within Namespace 2.0.
Definition: jsondef.h:4547
uint16_t flags
Definition: jsondef.h:3579
motrstruc motr
Definition: jsondef.h:3706
vector< devicestruc > device
Vector of all general (common) information for devices (components) in node.
Definition: jsondef.h:4238
nodestruc node
Structure for summary information in node.
Definition: jsondef.h:4220
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3334
jsonhandle handle
Handle of condition that caused event, NULL if timed event.
Definition: jsondef.h:1129
string value
Definition: jsondef.h:1254
rmatrix s2j
Definition: convertdef.h:600
Definition: jsondef.h:606
bool equal_ass(char a, char b)
Checks if two operators have equal precedence.
Definition: jsondef.h:7713
uint16_t prop_cnt
Definition: jsondef.h:3876
float temp
Definition: jsondef.h:3426
vector< uint16_t > suchi
Definition: jsondef.h:3917
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1839
rvector dgeocv
Geocentric velocity error: x, y, z.
Definition: jsondef.h:2170
double utc
Definition: convertdef.h:477
string token
Character token for request.
Definition: jsondef.h:886
Definition: jsondef.h:651
Definition: jsondef.h:572
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2908
quaternion align
Rotates vectors from MTR frame to Body frame.
Definition: jsondef.h:1989
double z
Definition: vector.h:714
Receiver information.
Definition: jsondef.h:2315
JSON equation operand.
Definition: jsondef.h:846
Definition: jsondef.h:281
All Component structure.
Definition: jsondef.h:1582
vector< Vector > Vg
Definition: objlib.h:319
string description
Definition: jsondef.h:890
Definition: jsondef.h:612
tncstruc tnc
Definition: jsondef.h:3723
void set_PQW_from_IJK()
Definition: jsondef.h:4464
uint16_t telem_cnt
Definition: jsondef.h:3889
avector euler
Attitude Euler angles.
Definition: jsondef.h:1867
static double * p
Definition: gauss_jackson_test.cpp:42
uint16_t port_cnt
Definition: jsondef.h:3572
geoidpos selg
Definition: convertdef.h:742
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1273
Intensity.
Definition: jsondef.h:81
tlestruc
Definition: jsondef.h:166
void dump(std::string &out) const
rvector s
Location.
Definition: convertdef.h:163
JSON Name type.
Definition: jsondef.h:206
JSON Satellite Position Structure.
Definition: jsondef.h:272
Vector material_specular
Material specular reflective qualities.
Definition: jsondef.h:1495
char address[]
Definition: netperf_listen.cpp:69
Radio Transceiver.
Definition: jsondef.h:512
vector< equationstruc > equation
Vector of Equations.
Definition: jsondef.h:4217
Definition: jsondef.h:3275
JSON Lunar Centered Inertial Position.
Definition: jsondef.h:249
Speed.
Definition: jsondef.h:87
JSON Earth Centered Inertial Attitude.
Definition: jsondef.h:268
float hcap
Definition: jsondef.h:3424
uint16_t unit_index
Index to JSON Unit Type.
Definition: jsondef.h:870
Definition: jsondef.h:583
Torque.
Definition: jsondef.h:107
uint16_t txr_cnt
Definition: jsondef.h:3893
JSON LVLH Attitude.
Definition: jsondef.h:270
quaternion align
alignment quaternion
Definition: jsondef.h:1861
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:783
rmatrix de2j
Definition: convertdef.h:595
Definition: jsondef.h:245
rvector bdot
Magnetic field rate change in sensor frame.
Definition: jsondef.h:1875
JSON Satellite Attitude Structure.
Definition: jsondef.h:274
eventstruc
Definition: jsondef.h:156
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2967
List count.
Definition: jsondef.h:554
Definition: jsondef.h:282
vector< face > Faces
Definition: objlib.h:327
mtrstruc mtr
Definition: jsondef.h:3707
#define COSMOS_MAX_DATA
Definition: cosmos-defs.h:53
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1945
uint16_t tnc_cnt
Definition: jsondef.h:3892
Definition: jsondef.h:591
static uint16_t model
Definition: add_radio.cpp:19
Reaction Wheel structure: z axis is aligned with axis of rotation.
Definition: jsondef.h:1920
attstruc att
attstruc for this time.
Definition: convertdef.h:883
Acceleration.
Definition: jsondef.h:89
vector< uint16_t > rot
Definition: jsondef.h:3912
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
Definition: jsondef.h:605
Inertial Measurement Unit (IMU) structure.
Definition: jsondef.h:1858
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2753
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:3126
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2825
rxrstruc rxr
Definition: jsondef.h:3714
uint16_t pvstrg_cnt
Definition: jsondef.h:3883
JSON_UPDATE
Things to update.
Definition: jsondef.h:303
Definition: jsondef.h:598
3 element attitude vector.
Definition: vector.h:277
JSON 16 bit unsigned integer type.
Definition: jsondef.h:192
double utcoffset
MJD Offset between system UT and simulated UT.
Definition: jsondef.h:3590
Vector htorque
Definition: jsondef.h:3441
uint16_t gps_cnt
Definition: jsondef.h:3869
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2666
uint32_t downtime
Seconds Node will be down.
Definition: jsondef.h:3582
Transceiver information.
Definition: jsondef.h:2499
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
uint16_t user_cnt
Definition: jsondef.h:3576
Transmitter information.
Definition: jsondef.h:2407
string pieces
Definition: jsondef.h:732
Definition: jsondef.h:586
Definition: jsondef.h:564
double phi
N/S in radians.
Definition: vector.h:170
double tdb
Dynamical Barycentric Time.
Definition: convertdef.h:588
gvector a
Acceleration vector.
Definition: convertdef.h:267
quaternion align
alignment quaternion
Definition: jsondef.h:3142
uint16_t batt_cnt
Definition: jsondef.h:3864
JSON cartpos.
Definition: jsondef.h:228
Thruster.
Definition: jsondef.h:524
vector< uint16_t > tcv
Definition: jsondef.h:3920
htrstruc htr
Definition: jsondef.h:3703
quaternion theta
Attitude quaternion.
Definition: jsondef.h:1865
Definition: jsondef.h:595
Pressure.
Definition: jsondef.h:109
BCREG (PV Regulator) Structure definition.
Definition: jsondef.h:3253
Face structure: information on each face of a piece.
Definition: jsondef.h:1399
qatt selc
Definition: convertdef.h:829
Definition: jsondef.h:2157
JSON map offset entry.
Definition: jsondef.h:4164
Complement ~.
Definition: jsondef.h:348
static double minelev
Definition: get_contacts.cpp:60
void from_json(const string &js)
Set class contents from JSON string.
Definition: jsondef.h:3501
string value
Definition: jsondef.h:836
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3199
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:4006
vector< uint16_t > disk
Definition: jsondef.h:3901
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2628
Payload.
Definition: jsondef.h:492
beatstruc beat
Heartbeat.
Definition: jsondef.h:1029
Vector rtorque
Definition: jsondef.h:3439
vector< uint16_t > motr
Definition: jsondef.h:3906
double utc
Definition: convertdef.h:735
SUCHI.
Definition: jsondef.h:542
const std::string & string_value() const
Definition: json11.cpp:283
char name[40+1]
Node Name.
Definition: jsondef.h:3556
JHUFF_TBL long freq[]
Definition: jchuff.h:47
Density.
Definition: jsondef.h:91
rvector geocs
Definition: jsondef.h:2164
uint16_t state
Operational state.
Definition: jsondef.h:3564
uint16_t bus_cnt
Definition: jsondef.h:3865
Definition: jsondef.h:277
Date.
Definition: jsondef.h:75
equationstruc
Definition: jsondef.h:168
vector< string > get_all_names() const
Get every name within Namespace 2.0.
Definition: jsondef.h:4591
uint16_t all_cnt
Definition: jsondef.h:3862
Heater Structure definition.
Definition: jsondef.h:2705
Definition: socketlib.h:115
gpsstruc gps
Definition: jsondef.h:3702
vector< vector< uint16_t > > triangleindex
Definition: jsondef.h:3328
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1536
Headers and definitions common to all COSMOS.
bool bool_value() const
Definition: json11.cpp:282
Definition: jsondef.h:3187
double utcstart
Mission start time.
Definition: jsondef.h:3594
vector< uint16_t > cam
Definition: jsondef.h:3899
qatt icrf
Definition: convertdef.h:830
pvstrgstruc pvstrg
Definition: jsondef.h:3711
Definition: jsondef.h:649
Vector rdrag
Definition: jsondef.h:3446
portstruc
Definition: jsondef.h:164
vector< uint16_t > thst
Definition: jsondef.h:3922
double lasteventutc
Last event UTC.
Definition: jsondef.h:3560
JSON Geodetic Position.
Definition: jsondef.h:255
void replace(std::string &str, const std::string &from, const std::string &to)
Replace every occurance of a substring within a string with another subtring.
Definition: jsondef.h:7533
string name
Definition: cubesat2obj.cpp:6
const array & array_items() const
Definition: json11.cpp:284
JSON dcmatt.
Definition: jsondef.h:234
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2196
NetworkType
Definition: socketlib.h:63
void from_json(const string &js)
Set class contents from JSON string.
Definition: jsondef.h:3645
Socket Support header file.
string get_json(const string &s)
Gets a JSON-formatted string of the data associated with the provided name in Namespace 2...
Definition: jsondef.h:7297
double x
Definition: vector.h:712
uint16_t tle_cnt
Definition: jsondef.h:3577
locstruc loc
Location structure.
Definition: jsondef.h:3596
JSON cartpos.
Definition: jsondef.h:226
Definition: jsondef.h:260
quaternion att
includes 0 and 1st order derivative
Definition: jsondef.h:2939
Another equation.
Definition: jsondef.h:319
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:431
Modulo %.
Definition: jsondef.h:334
Definition: jsondef.h:883
jsonhandle data
Definition: jsondef.h:854
rmatrix dde2j
Definition: convertdef.h:596
Definition: jsondef.h:580
Nothing at all.
Definition: jsondef.h:313
string targets
Definition: jsondef.h:736
Full COSMOS Event structure.
Definition: jsondef.h:1093
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3239
Camera.
Definition: jsondef.h:544
vector< agent_request_entry > reqs
Agent request list.
Definition: jsondef.h:1027
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2096
vector< uint8_t > data
vector of actual data
Definition: jsondef.h:4179
double h
Height in meters.
Definition: vector.h:229
Vector ctorque
Definition: jsondef.h:3443
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:705
void from_json(const string &js)
Set class contents from JSON string.
Definition: jsondef.h:3794
vector< userstruc > user
Single entry vector for user information.
Definition: jsondef.h:4256
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:815
extrapos extra
Definition: convertdef.h:744
vector< uint16_t > telem
Definition: jsondef.h:3921
vector< Vector > Vn
Definition: objlib.h:321
void from_json(const string &s)
Set class contents from JSON string.
Definition: objlib.h:356
Pressure sensor.
Definition: jsondef.h:540
Magnetic Torque Rod structure: z axis is aligned with rod.
Definition: jsondef.h:1986
JSON 32 bit integer type.
Definition: jsondef.h:196
Vector com
Definition: jsondef.h:1403
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:3215
Vector atorque
Definition: jsondef.h:3438
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2470
int32_t stateflag
Definition: agent_data-2-0.cpp:78
Definition: jsondef.h:600
rvector accel
Position acceleration vector.
Definition: jsondef.h:1863
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1330
x
Definition: inputfile.py:6
Vector hmomentum
Definition: jsondef.h:3442
uint16_t vertex_cnt
Definition: jsondef.h:3567
Definition: jsondef.h:288
Definition: jsondef.h:590
Port structure.
Definition: jsondef.h:1357
uint16_t cpu_cnt
Definition: jsondef.h:3867
JSON Boolean.
Definition: jsondef.h:188
JSON Topocentric Attitude.
Definition: jsondef.h:262
Vector com
Centroid of piece.
Definition: jsondef.h:1477
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2950
uint16_t rw_cnt
Definition: jsondef.h:3880
A simple constant.
Definition: jsondef.h:315
nodestruc
Definition: jsondef.h:146
gvector geods
Geodetic position: longitude, latitude, altitude.
Definition: jsondef.h:2172
double lon
Longitude in radians.
Definition: vector.h:227
double w
Rotation.
Definition: vector.h:407
Magnetic Moment.
Definition: jsondef.h:129
Luminance.
Definition: jsondef.h:93
gige_handle * handle
Definition: kpc9612p_recv.cpp:33
void print_all_names_types() const
Prints every name and the associated type within Namespace 2.0.
Definition: jsondef.h:4529
rvector geocv
Geocentric velocity: x, y, z.
Definition: jsondef.h:2166
vector< uint16_t > tsen
Definition: jsondef.h:3924
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1216
entirety
Definition: jsondef.h:175
double equationator(const string &str)
Evaluate the expression of a python?Matlab? equation.
Definition: jsondef.h:7825
string get_name(void *v)
Gets the name associated with the provided memory address in Namespace 2.0.
Definition: jsondef.h:6753
sttstruc stt
Definition: jsondef.h:3716
rmatrix t2j
Definition: convertdef.h:599
mccstruc mcc
Definition: jsondef.h:3705
static uint8_t opmode
Definition: add_radio.cpp:23
float elto
Definition: jsondef.h:3587
string utcstart
Definition: jsondef.h:729
Telemetry (TELEM) structure.
Definition: jsondef.h:1699
Definition: eci2kep_test.cpp:33
rvector omega
Definition: jsondef.h:2940
float powuse
Definition: jsondef.h:3433
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2293
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:956
Power Bus.
Definition: jsondef.h:538
JSON equation entry.
Definition: jsondef.h:865
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3931
Propellant Tank.
Definition: jsondef.h:526
Definition: jsondef.h:604
Definition: jsondef.h:596
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2538
rvector mom
Moments of inertia in RW frame.
Definition: jsondef.h:1925
Addition +.
Definition: jsondef.h:326
JSON token.
Definition: jsondef.h:833
JSON extraatt.
Definition: jsondef.h:236
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:3369
Vector com
center of mass
Definition: jsondef.h:3280
#define AGENTMAXIF
Maximum number of supported publication interfaces.
Definition: jsondef.h:440
cartpos sci
Definition: convertdef.h:738
char * text
JSON equation text.
Definition: jsondef.h:868
jsonnode json
JSON descriptive information.
Definition: jsondef.h:4262
JSON Agent Heartbeat.
Definition: jsondef.h:242
string ports
Definition: jsondef.h:735
mathlib include file
static std::vector< Json > parse_multi(const std::string &in, std::string::size_type &parser_stop_pos, std::string &err, JsonParse strategy=JsonParse::STANDARD)
agentstruc
Definition: jsondef.h:148
Definition: jsondef.h:582
JSON double precision floating vertex type.
Definition: jsondef.h:200
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
Vector normal
outward facing normal
Definition: jsondef.h:3282
float heat
Definition: jsondef.h:3427
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3081
Electric Potential.
Definition: jsondef.h:117
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:485
double z
Z value.
Definition: vector.h:116
JSON handle.
Definition: jsondef.h:791
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2274
gvector s
Position vector.
Definition: convertdef.h:263
Logical Not !
Definition: jsondef.h:346
Definition: jsondef.h:608
Definition: jsondef.h:283
rmatrix j2b
Transform from ICRF to Body frame.
Definition: convertdef.h:694
Definition: jsondef.h:654
Agent control structure.
Definition: jsondef.h:1006
double lat
Latitude in radians.
Definition: vector.h:225
imustruc imu
Definition: jsondef.h:3704
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1965
Definition: eci2kep_test.cpp:33
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1169
JSON 8 bit signed integer type.
Definition: jsondef.h:184
vertexstruc
Definition: jsondef.h:170
DeviceType
Definition: jsondef.h:490
swchstruc swch
Definition: jsondef.h:3718
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1627
Definition: objlib.h:13
string name
Definition: jsondef.h:726
vector< uint16_t > cpu
Definition: jsondef.h:3900
vector< uint16_t > bcreg
Definition: jsondef.h:3897
Current.
Definition: jsondef.h:77
GPS Unit.
Definition: jsondef.h:504
void pretty_form(string &js)
Pretty-fy text.
Definition: jsondef.h:7549
qatt topo
Definition: convertdef.h:826
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:3247
float mass
Definition: jsondef.h:3425
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1369
Definition: jsondef.h:895
struct ip_mreq group
Definition: mcastclient.c:39
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1734
float sunsize
Radius of sun in radians.
Definition: convertdef.h:750
JSON 32 bit unsigned integer type.
Definition: jsondef.h:190
Bitwise AND .
Definition: jsondef.h:352
JSON cartpos.
Definition: jsondef.h:224
name_map names
Definition: jsondef.h:4499
Definition: jsondef.h:573
#define MAXPLOADKEYCNT
Maximum number of Special Payload Keys.
Definition: jsondef.h:416
locstruc loc
Definition: jsondef.h:1302
vector< agentstruc > agent
Single entry vector for agent information.
Definition: jsondef.h:4247
Vector shove
Contribution of piece to linear forces.
Definition: jsondef.h:1479
Definition: jsondef.h:724
string state
Definition: jsondef.h:728
Processing Unit.
Definition: jsondef.h:502
bool left_ass(char a)
Checks if operator is left-associative.
Definition: jsondef.h:7696
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1657
JSON svector.
Definition: jsondef.h:220
NetworkType ntype
Definition: agent_node.cpp:50
Definition: jsondef.h:648
JSON ::Vector.
Definition: jsondef.h:208
uint16_t ant_cnt
Definition: jsondef.h:3863
quaternion s
0th derivative: Quaternion
Definition: convertdef.h:479
DeviceCpu cpu
Definition: agent_example.cpp:58
uint16_t face_cnt
Definition: jsondef.h:3569
Definition: jsondef.h:278
Antenna.
Definition: jsondef.h:506
type_map types
Definition: jsondef.h:4500
psenstruc psen
Definition: jsondef.h:3710
rvector alpha
Attitude acceleration vector.
Definition: jsondef.h:1871
vector< uint16_t > tnc
Definition: jsondef.h:3923
ploadstruc pload
Definition: jsondef.h:3708
vector< line > Lines
Definition: objlib.h:326
targetstruc
Definition: jsondef.h:160
tcvstruc tcv
Definition: jsondef.h:3720
Time.
Definition: jsondef.h:73
Battery.
Definition: jsondef.h:516
vector< piecestruc > pieces
Vector of all pieces in node.
Definition: jsondef.h:4232
void set_json(const string &json)
Sets the data in Namespace 2.0 with a JSON-formatted string.
Definition: jsondef.h:6822
pair< string, void * > name_mapping
Definition: jsondef.h:4494
uint16_t rxr_cnt
Definition: jsondef.h:3881
double col[3]
Definition: vector.h:55
vector< uint16_t > all
Definition: jsondef.h:3894
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1765
double dt
Time step in seconds.
Definition: jsondef.h:3414
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:3013
Definition: jsondef.h:645
socket_channel sub
Subscription channel (for Client)
Definition: jsondef.h:1011
void set_up_rotation_matrix()
Definition: jsondef.h:4401
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1411
JSON single precision floating vertex type.
Definition: jsondef.h:198
SUCHI Sructure.
Definition: jsondef.h:3139
JSON locstruc type.
Definition: jsondef.h:276
bcregstruc bcreg
Definition: jsondef.h:3697
svector v
Velocity vector.
Definition: convertdef.h:320
JSON Alias.
Definition: jsondef.h:296
extraatt extra
Definition: convertdef.h:831
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2378
propstruc prop
Definition: jsondef.h:3709
Multiplication *.
Definition: jsondef.h:330
vector< uint16_t > vertex_idx
Definition: jsondef.h:1402
JSON char* type.
Definition: jsondef.h:202
cartpos eci
Definition: convertdef.h:737
busstruc bus
Definition: jsondef.h:3698
double utc
Definition: convertdef.h:316
Definition: jsondef.h:287
Definition: jsondef.h:611
#define JSON_MAX_DATA
Largest JSON data.
Definition: jsondef.h:427
gvector dgeods
Geodetic position error: longitude, latitude, altitude.
Definition: jsondef.h:2176
uint16_t rot_cnt
Definition: jsondef.h:3879
Agent socket using Multicast UDP.
map< string, void * > name_map
Support for Namespace 2.0.
Definition: jsondef.h:4493
Definition: jsondef.h:3553
JSON Equation.
Definition: jsondef.h:294
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:3267
rmatrix b2j
Transform from Body frame to ICRF.
Definition: convertdef.h:696
telemstruc telem
Definition: jsondef.h:3721
rmatrix dj2e
Definition: convertdef.h:591
Definition: jsondef.h:652
Definition: jsondef.h:568
Magnetic Flux Density.
Definition: jsondef.h:127
battstruc batt
Definition: jsondef.h:3696
vector< eventstruc > event
Single entry vector for event information.
Definition: jsondef.h:4250
uint16_t thst_cnt
Definition: jsondef.h:3890
Specific Device structure.
Definition: jsondef.h:3860
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:80
Random Access Memory and Disk Storage.
Definition: jsondef.h:133
void set_value(const string &s, const T &value) const
Sets the value of the data associated with the provided name in Namespace 2.0.
Definition: jsondef.h:6808
float azfrom
Alt/Az/Range info.
Definition: jsondef.h:3584
geoidpos geod
Definition: convertdef.h:741
double r
Radius in meters.
Definition: vector.h:174
int32_t(* agent_request_function)(char *request_string, char *output_string, void *root)
Definition: jsondef.h:879
quaternion align
Flow.
Definition: jsondef.h:2801
Star Tracker.
Definition: jsondef.h:532
devspecstruc devspec
Structure for devices (components) special data in node, by type.
Definition: jsondef.h:4241
size_t size()
Returns the length of the map used to represent Namespace 2.0.
Definition: jsondef.h:4514
vector< Vector > Vp
Definition: objlib.h:322
quaternion align
Alignment.
Definition: jsondef.h:2254
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2811
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:269
int32_t mode
Definition: jsondef.h:3436
uint16_t index
Definition: jsondef.h:796
float azto
Definition: jsondef.h:3586
rmatrix e2j
Transform from Geocentric to ICRF.
Definition: convertdef.h:594
uint16_t tcu_cnt
Definition: jsondef.h:3887
string devgen
Definition: jsondef.h:733
gvector geodv
Geodetic velocity: longitude, latitude, altitude.
Definition: jsondef.h:2174
JSON unit type entry.
Definition: jsondef.h:672
svector a
Acceleration vector.
Definition: convertdef.h:322
Definition: jsondef.h:279
Definition: jsondef.h:289
TNC.
Definition: jsondef.h:550
vector< uint16_t > swch
Definition: jsondef.h:3918
vector< vector< jsonentry > > jmap
JSON Namespace Map matrix. first entry hash, second is items with that hash.
Definition: jsondef.h:4208
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1881
Torque rod Control Unit.
Definition: jsondef.h:536
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2920
vector< targetstruc > target
Vector of all targets known to node.
Definition: jsondef.h:4253
JSON posstruc.
Definition: jsondef.h:238
static string node
Definition: agent_monitor.cpp:126
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:324
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2864
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1900
Disk Drive.
Definition: jsondef.h:548
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:1382
Vector Class.
Definition: vector.h:672
double value
Definition: jsondef.h:853
Definition: jsondef.h:560
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:7635
vector< uint16_t > psen
Definition: jsondef.h:3910
Definition: jsondef.h:4199
double utc
Coordinated Universal Time.
Definition: convertdef.h:692
Definition: jsondef.h:655
uint16_t type
Node Type as listed in NODE_TYPE.
Definition: jsondef.h:3562
Boolean Greater Than >
Definition: jsondef.h:340
cartpos icrf
Definition: convertdef.h:736
uint16_t mtr_cnt
Definition: jsondef.h:3874
vector< uint16_t > face_idx
Array of vertices/vertexs.
Definition: jsondef.h:1475
uint16_t cam_cnt
Definition: jsondef.h:3866
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1035
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2128
Radio Transmitter.
Definition: jsondef.h:510
rmatrix s2t
Definition: convertdef.h:601
Definition: jsondef.h:565
Definition: jsondef.h:578
Absolute pointer.
Definition: jsondef.h:144
Definition: jsondef.h:610
Thruster (THST) dynamic structure.
Definition: jsondef.h:2798
Definition: jsondef.h:3105
double utc
Simulated starting time in MJD.
Definition: jsondef.h:3418
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2142
antstruc ant
Definition: jsondef.h:3695
3 element geodetic vector
Definition: vector.h:222
wavefront obj
Wavefront obj structure.
Definition: jsondef.h:4235
double utc
Definition: convertdef.h:825
Sun Sensor (SSEN) Sructure.
Definition: jsondef.h:1806
Inertial Measurement Unit.
Definition: jsondef.h:496
Definition: jsondef.h:2781
Definition: jsondef.h:594
physicsstruc
Definition: jsondef.h:154
JSON gvector.
Definition: jsondef.h:218
Switch.
Definition: jsondef.h:528
Boolean Equal =.
Definition: jsondef.h:344
Area.
Definition: jsondef.h:83
JSON Selenocentric Position.
Definition: jsondef.h:253
JSON Solar Barycentric Position.
Definition: jsondef.h:244
double ut
UT0.
Definition: convertdef.h:586
#define COSMOS_MAX_NAME
Largest JSON name.
Definition: jsondef.h:429
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:3114
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:256
rmatrix j2t
Definition: convertdef.h:597
vector< uint16_t > batt
Definition: jsondef.h:3896
Torque Rod Control Unit.
Definition: jsondef.h:3029
gvector v
Velocity vector.
Definition: convertdef.h:265
Disk information.
Definition: jsondef.h:2114
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:764
rvector row[3]
Definition: matrix.h:43
Definition: convertdef.h:876
uint16_t operation
JSON equation operation.
Definition: jsondef.h:872
void set_IJK_from_PQW()
Definition: jsondef.h:4451
double dtj
Time step in Julian days.
Definition: jsondef.h:3416
double w
Definition: vector.h:715
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1260
Definition: jsondef.h:562
Orbit library support definitions.
Vector twist
Contribution of piece to angular forces.
Definition: jsondef.h:1481
int int_value() const
Definition: json11.cpp:281
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:1308
physicsstruc phys
Definition: jsondef.h:3597
Definition: jsondef.h:563
Definition: jsondef.h:609
Division /.
Definition: jsondef.h:332
cpustruc cpu
Definition: jsondef.h:3700
gvector dgeodv
Geodetic velocity error: longitude, latitude, altitude.
Definition: jsondef.h:2178
rmatrix j2e
Transform from ICRF to Geocentric.
Definition: convertdef.h:590
json11::Json to_json() const
Convert class contents to a JSON object.
Definition: jsondef.h:7605
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2998
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2444
ssenstruc ssen
Definition: jsondef.h:3715
Propellant Tank (PROP) structure.
Definition: jsondef.h:2840
float elfrom
Definition: jsondef.h:3585
vector< trianglestruc > triangles
Definition: jsondef.h:3452
Moment of Inertia.
Definition: jsondef.h:71
JSON quaternion type.
Definition: jsondef.h:216
Power ^.
Definition: jsondef.h:350
Definition: jsondef.h:597
Logarithm.
Definition: jsondef.h:58
uint16_t htr_cnt
Definition: jsondef.h:3870
Vector material_ambient
Material ambient reflective qualities.
Definition: jsondef.h:1491
Boolean Or |.
Definition: jsondef.h:338
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:2222
float powgen
Definition: jsondef.h:3432
Definition: jsondef.h:285
Angular acceleration.
Definition: jsondef.h:99
Payload (PLOAD) structure.
Definition: jsondef.h:1752
vector< uint16_t > pvstrg
Definition: jsondef.h:3911
Temperature Sensor.
Definition: jsondef.h:522
tsenstruc tsen
Definition: jsondef.h:3724
camstruc cam
Definition: jsondef.h:3699
Definition: jsondef.h:286
rvector v
Velocity.
Definition: convertdef.h:165
Star Tracker (STT) Sructure.
Definition: jsondef.h:2934
Definition: jsondef.h:577
Definition: eci2kep_test.cpp:33
vector< uint16_t > mcc
Definition: jsondef.h:3905
uint16_t stt_cnt
Definition: jsondef.h:3884
Rotor Structure definition.
Definition: jsondef.h:2899
double number_value() const
Definition: json11.cpp:280
Motion Capture Camera.
Definition: jsondef.h:534
json11::Json to_json() const
Convert class contents to JSON object.
Definition: jsondef.h:2851
JSON Selenographic Position.
Definition: jsondef.h:259
string vertexs
Definition: jsondef.h:730
vector< uint16_t > ssen
Definition: jsondef.h:3915
Volume.
Definition: jsondef.h:85
JSON char type.
Definition: jsondef.h:186
const object & object_items() const
Definition: json11.cpp:285
thststruc thst
Definition: jsondef.h:3722
PV String (STRG) structure.
Definition: jsondef.h:2595
Mass.
Definition: jsondef.h:69
Definition: jsondef.h:280
CPU information.
Definition: jsondef.h:2056
Definition: jsondef.h:593