Commit dc197c58 authored by Christopher Reis's avatar Christopher Reis

Updated for use in Docker

parent 33d3594f
...@@ -64,7 +64,7 @@ struct subsystem { ...@@ -64,7 +64,7 @@ struct subsystem {
measurement getMeasurement(std::string m){ measurement getMeasurement(std::string m){
measurement ret; measurement ret;
for(std::vector<measurement>::iterator it = v.begin();it != v.end();++it){ for(std::vector<measurement>::iterator it = v.begin();it != v.end();++it){
std::cout << "Searching...." << it->name << m << '\n'; //std::cout << "Searching...." << it->name << m << '\n';
if(it->name==m){ if(it->name==m){
ret.name = it->name; ret.name = it->name;
ret.v = it->v; ret.v = it->v;
...@@ -85,8 +85,8 @@ struct subsystem { ...@@ -85,8 +85,8 @@ struct subsystem {
} }
}; };
std::string load_dictionary(){ std::string load_dictionary(std::string input){
std::string filename = "dictionary.json"; std::string filename = input;
std::ifstream file; std::ifstream file;
file.open(filename.c_str(), std::ios::in); file.open(filename.c_str(), std::ios::in);
if(!file){ if(!file){
......
...@@ -337,7 +337,7 @@ class telemetry_server { ...@@ -337,7 +337,7 @@ class telemetry_server {
void update_msg_queue(){ void update_msg_queue(){
for(std::vector<std::string>::iterator it = topics.begin();it != topics.end();it++){ for(std::vector<std::string>::iterator it = topics.begin();it != topics.end();it++){
measurement meas = systemdata.getMeasurement(*it); measurement meas = systemdata.getMeasurement(*it);
std::cout << "FOUND: " << meas.name << '\n'; //std::cout << "FOUND: " << meas.name << '\n';
jtopics.push_back(json_pack(meas.name,meas.timestamp,meas.v)); jtopics.push_back(json_pack(meas.name,meas.timestamp,meas.v));
} }
} }
...@@ -465,7 +465,8 @@ int main(int argc, char* argv[]) ...@@ -465,7 +465,8 @@ int main(int argc, char* argv[])
gmsub g = gmsub(config); gmsub g = gmsub(config);
//load dictionary //load dictionary
dictionary = load_dictionary(); std::string filename = example::get(config, "dictionary", "/GMSEC_API/bin/dictionary.json");
dictionary = load_dictionary(filename);
//Threads //Threads
std::thread gmsec(&gmsub::run,&g); std::thread gmsec(&gmsub::run,&g);
......
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