Commit 75e27ec4 authored by Christopher Reis's avatar Christopher Reis

Fixed historical bug

parent 654fb527
...@@ -84,9 +84,9 @@ struct subsystem { ...@@ -84,9 +84,9 @@ struct subsystem {
//int num_fields = mysql_num_fields(r); //int num_fields = mysql_num_fields(r);
MYSQL_ROW row; MYSQL_ROW row;
while((row=mysql_fetch_row(r))){ while((row=mysql_fetch_row(r))){
json_val["timestamp"]=row[0]; json_val["timestamp"]=std::stol(row[0]);
json_val["value"]=row[1]; json_val["value"]=row[1];
json_re["value"] += json_val; json_re.push_back(json_val);
} }
mysql_close(c); mysql_close(c);
} }
......
...@@ -347,8 +347,8 @@ class telemetry_server { ...@@ -347,8 +347,8 @@ class telemetry_server {
//remove whitespace //remove whitespace
val.erase(remove_if(val.begin(),val.end(),isspace),val.end()); val.erase(remove_if(val.begin(),val.end(),isspace),val.end());
nlohmann::json re; nlohmann::json re;
re["type"] = "history";
re["id"] = val; re["id"] = val;
re["type"] = "history";
re["value"] = systemdata.getHistory(val); re["value"] = systemdata.getHistory(val);
return re; return re;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment