Skip to content
Snippets Groups Projects
Commit e3da2285 authored by Jörn Künsemöller's avatar Jörn Künsemöller
Browse files

TMSS-159: change reference time in MACscheduler back to scheduled_on_sky

parent bc8d832c
No related branches found
No related tags found
2 merge requests!634WIP: COBALT commissioning delta,!598TMSS-159: change reference time in MACscheduler back to scheduled_on_sky
...@@ -797,7 +797,7 @@ void MACScheduler::_updatePlannedList() ...@@ -797,7 +797,7 @@ void MACScheduler::_updatePlannedList()
if (!upcomingSubTasks.empty()) { if (!upcomingSubTasks.empty()) {
LOG_DEBUG(formatString("TMSSCheck:First planned observation (%s) is at %s", LOG_DEBUG(formatString("TMSSCheck:First planned observation (%s) is at %s",
upcomingSubTasks[0]["url"].asCString(), upcomingSubTasks[0]["scheduled_process_start_time"].asCString())); upcomingSubTasks[0]["url"].asCString(), upcomingSubTasks[0]["scheduled_on_sky_start_time"].asCString()));
} }
// make a copy of the current prepared observations (= observations shown in the navigator in the 'future' // make a copy of the current prepared observations (= observations shown in the navigator in the 'future'
...@@ -913,7 +913,7 @@ void MACScheduler::_updatePlannedList() ...@@ -913,7 +913,7 @@ void MACScheduler::_updatePlannedList()
// construct name and timings info for observation // construct name and timings info for observation
string obsName(observationName(subtask_id)); string obsName(observationName(subtask_id));
ptime start_time = time_from_string(subtask["scheduled_process_start_time"].asString().replace(10, 1, " ")); ptime start_time = time_from_string(subtask["scheduled_on_sky_start_time"].asString().replace(10, 1, " "));
ptime modTime = time_from_string(subtask["updated_at"].asString().replace(10, 1, " ")); ptime modTime = time_from_string(subtask["updated_at"].asString().replace(10, 1, " "));
// remove obs from backup of the planned-list (it is in the list again) // remove obs from backup of the planned-list (it is in the list again)
......
...@@ -83,7 +83,7 @@ Json::Value TMSSBridge::getSubTasksStartingInThreeMinutes() ...@@ -83,7 +83,7 @@ Json::Value TMSSBridge::getSubTasksStartingInThreeMinutes()
ptime upper_limit = from_time_t(now+3*60); ptime upper_limit = from_time_t(now+3*60);
//TODO: make exact query as in SAS/OTDB/sql/getTreeGroup_func.sql with OR'd states and exact timewindow //TODO: make exact query as in SAS/OTDB/sql/getTreeGroup_func.sql with OR'd states and exact timewindow
string queryStr = "/api/subtask/?state__value=scheduled&scheduled_process_start_time__gt=" + to_iso_extended_string(lower_limit) + "&scheduled_process_start_time__lt=" + to_iso_extended_string(upper_limit) + "&ordering=scheduled_process_start_time"; string queryStr = "/api/subtask/?state__value=scheduled&scheduled_on_sky_start_time__gt=" + to_iso_extended_string(lower_limit) + "&scheduled_on_sky_start_time__lt=" + to_iso_extended_string(upper_limit) + "&ordering=scheduled_on_sky_start_time";
Json::Value result; Json::Value result;
if(httpGETAsJson(queryStr, result)) if(httpGETAsJson(queryStr, result))
...@@ -95,7 +95,7 @@ Json::Value TMSSBridge::getActiveSubTasks() ...@@ -95,7 +95,7 @@ Json::Value TMSSBridge::getActiveSubTasks()
{ {
ptime now = from_time_t(time(0)); ptime now = from_time_t(time(0));
//TODO: make exact query as in SAS/OTDB/sql/getTreeGroup_func.sql with OR'd states and exact timewindow //TODO: make exact query as in SAS/OTDB/sql/getTreeGroup_func.sql with OR'd states and exact timewindow
string queryStr = "/api/subtask/?state__value=started&scheduled_process_start_time__lt=" + to_iso_extended_string(now) + "&scheduled_process_stop_time__gt=" + to_iso_extended_string(now) + "&ordering=scheduled_process_start_time"; string queryStr = "/api/subtask/?state__value=started&scheduled_on_sky_start_time__lt=" + to_iso_extended_string(now) + "&scheduled_on_sky_stop_time__gt=" + to_iso_extended_string(now) + "&ordering=scheduled_on_sky_start_time";
Json::Value result; Json::Value result;
if(httpGETAsJson(queryStr, result)) if(httpGETAsJson(queryStr, result))
...@@ -107,7 +107,7 @@ Json::Value TMSSBridge::getFinishingSubTasks() ...@@ -107,7 +107,7 @@ Json::Value TMSSBridge::getFinishingSubTasks()
{ {
ptime justnow = from_time_t(time(0)-3*60); ptime justnow = from_time_t(time(0)-3*60);
//TODO: make exact query as in SAS/OTDB/sql/getTreeGroup_func.sql with OR'd states and exact timewindow //TODO: make exact query as in SAS/OTDB/sql/getTreeGroup_func.sql with OR'd states and exact timewindow
string queryStr = "/api/subtask/?state__value=finishing&scheduled_process_stop_time__gt=" + to_iso_extended_string(justnow) + "&ordering=scheduled_process_start_time"; string queryStr = "/api/subtask/?state__value=finishing&scheduled_on_sky_stop_time__gt=" + to_iso_extended_string(justnow) + "&ordering=scheduled_on_sky_start_time";
Json::Value result; Json::Value result;
if(httpGETAsJson(queryStr, result)) if(httpGETAsJson(queryStr, result))
...@@ -161,7 +161,7 @@ std::size_t callback(const char* in, ...@@ -161,7 +161,7 @@ std::size_t callback(const char* in,
// Need to check response status code of http (200) // Need to check response status code of http (200)
// Inspired by https://gist.github.com/connormanning/41efa6075515019e499c // Inspired by https://gist.github.com/connormanning/41efa6075515019e499c
// Example: // Example:
// httpQuery("/api/subtask/?scheduled_process_start_time__lt=2020-03-04T12:03:00") // httpQuery("/api/subtask/?scheduled_on_sky_start_time__lt=2020-03-04T12:03:00")
// results in a json string output // results in a json string output
// //
bool TMSSBridge::httpQuery(const string& target, string &result, const string& query_method, const string& data) bool TMSSBridge::httpQuery(const string& target, string &result, const string& query_method, const string& data)
......
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