Skip to content

Commit

Permalink
Dontcheckversion (#31)
Browse files Browse the repository at this point in the history
* update Services to rename GetConfig/SendConfig to GetDeviceConfig and SendDeviceConfig, and add new functions GetRunConfig,SendRunConfig as well as GetRunDeviceConfig

* BUGFIX inverted query success checks

* runconfig WIP

* whoops

---------

Co-authored-by: Marcus O'Flaherty <[email protected]>
  • Loading branch information
marc1uk and superkanalysis authored Oct 12, 2024
1 parent 4db1b79 commit 5dc6e47
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/ServiceDiscovery/Services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,9 @@ bool Services::GetRunConfig(std::string& json_data, const int config_id, const u
// response format '{"data":<contents>}' - strip out contents
Store tmp;
tmp.JsonParser(json_data);
int tmp_version;
bool ok = tmp.Get("version",tmp_version);
if(ok){
//version = tmp_version; // cannot pass back
ok = tmp.Get("data", json_data);
}
bool ok = tmp.Get("data", json_data);
if(!ok){
std::cerr<<"GetRunConfig error: invalid response: '"<<json_data<<"'"<<std::endl;
std::clog<<"GetRunConfig error: invalid response: '"<<json_data<<"'"<<std::endl;
return false;
}

Expand Down Expand Up @@ -440,7 +435,7 @@ bool Services::GetROOTplot(const std::string& plot_name, int& version, std::stri
}

if(response.empty()){
std::cout<<"GetROOTplot error: empty response, "<<err<<std::endl;
std::clog<<"GetROOTplot error: empty response, "<<err<<std::endl;
json_data = err;
return false;
}
Expand Down Expand Up @@ -474,7 +469,7 @@ bool Services::GetROOTplot(const std::string& plot_name, int& version, std::stri
}

/*
std::cout<<"timestamp: "<<timestamp<<"\n"
std::clog<<"timestamp: "<<timestamp<<"\n"
<<"draw opts: "<<draw_options<<"\n"
<<"json data: '"<<json_data<<"'"<<std::endl;
*/
Expand Down

0 comments on commit 5dc6e47

Please sign in to comment.