Skip to content
Snippets Groups Projects
Commit 98c88e84 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-717: reverted to setting the queueing state just before the queued state....

TMSS-717: reverted to setting the queueing state just before the queued state. It's near impossible to keep MAC internal bookkeeping in sync with TMSS
parent d82a7a46
No related branches found
No related tags found
1 merge request!447TMSS-717: merge commissioning fixes back to master
......@@ -577,6 +577,9 @@ GCFEvent::TResult MACScheduler::active_state(GCFEvent& event, GCFPortInterface&
tm.setTreeState(theObs->second, tsc.get("queued"));
#endif
} else {
// TODO: set to queueing state the moment MAC knows about this upoming obs.
// I've tried that but it's realy hard to keep the MAC internal bookkeeping and TMSS in sync.
itsTMSSconnection->setSubtaskState(subtask_id, "queueing");
itsTMSSconnection->setSubtaskState(theObs->second, "queued");
}
break;
......@@ -922,8 +925,6 @@ void MACScheduler::_updatePlannedList()
OLiter prepIter = itsPreparedObs.find(subtask_id);
if ((prepIter == itsPreparedObs.end()) || (prepIter->second.prepReady == false) ||
(prepIter->second.modTime != modTime)) {
itsTMSSconnection->setSubtaskState(subtask_id, "queueing");
// create a ParameterFile for this Observation
string parsetText = itsTMSSconnection->getParsetAsText(subtask_id);
if(prepIter == itsPreparedObs.end()) {
......
......@@ -87,33 +87,7 @@ Json::Value TMSSBridge::getSubTasksStartingInThreeMinutes()
Json::Value result;
if(httpGETAsJson(queryStr, result))
LOG_INFO_STR(string("JSON data for ") << queryStr << std::endl << result.toStyledString());
result = result["results"];
LOG_INFO_STR(string("JSON data for ") << queryStr << std::endl << result.toStyledString());
// combine scheduled list with queuing list
string queryStr2 = "/api/subtask/?state__value=queueing&start_time__gt=" + to_iso_extended_string(lower_limit) + "&start_time__lt=" + to_iso_extended_string(upper_limit) + "&ordering=start_time";
Json::Value result2;
if(httpGETAsJson(queryStr2, result2)) {
LOG_INFO_STR(string("JSON data for ") << queryStr2 << std::endl << result2.toStyledString());
result2 = result2["results"];
LOG_INFO_STR(string("JSON data for ") << queryStr2 << std::endl << result2.toStyledString());
for (int32 idx =0; idx < result2.size(); idx++) {
Json::Value item = result2[idx];
LOG_INFO_STR(string("appending item ") << std::endl << item.toStyledString());
result.append(item);
}
}
LOG_INFO_STR(string("JSON data total") << std::endl << result.toStyledString());
return result;
return result["results"];
return Json::Value("");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment