From ec8e6f961637b843ec2ac1411e8c063ca6d0ff2c Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Tue, 28 Mar 2023 15:07:09 +0200
Subject: [PATCH] L2SS-1189: MACScheduler should only poll for tmss observation
 subtasks with lofar1 stations only

---
 MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc b/MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc
index dc31e3c2483..9eb6fdc3dfe 100644
--- a/MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc
@@ -83,7 +83,7 @@ Json::Value TMSSBridge::getObservationSubTasksStartingInThreeMinutes()
 	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
-    string queryStr = "/api/subtask/?subtask_type=observation&state__value=scheduled&scheduled_start_time__gt=" + to_iso_extended_string(lower_limit) + "&scheduled_start_time__lt=" + to_iso_extended_string(upper_limit) + "&ordering=scheduled_start_time";
+    string queryStr = "/api/subtask/?subtask_type=observation&state__value=scheduled&is_using_lofar2_stations=False&scheduled_start_time__gt=" + to_iso_extended_string(lower_limit) + "&scheduled_start_time__lt=" + to_iso_extended_string(upper_limit) + "&ordering=scheduled_start_time";
 
     Json::Value result;
     if(httpGETAsJson(queryStr, result))
@@ -95,7 +95,7 @@ Json::Value TMSSBridge::getActiveObservationSubTasks()
 {
 	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
-    string queryStr = "/api/subtask/?subtask_type=observation&state__value=started&scheduled_start_time__lt=" + to_iso_extended_string(now) + "&scheduled_stop_time__gt=" + to_iso_extended_string(now) + "&&ordering=scheduled_start_time";
+    string queryStr = "/api/subtask/?subtask_type=observation&state__value=started&is_using_lofar2_stations=False&scheduled_start_time__lt=" + to_iso_extended_string(now) + "&scheduled_stop_time__gt=" + to_iso_extended_string(now) + "&&ordering=scheduled_start_time";
 
     Json::Value result;
     if(httpGETAsJson(queryStr, result))
@@ -107,7 +107,7 @@ Json::Value TMSSBridge::getFinishingObservationSubTasks()
 {
 	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
-    string queryStr = "/api/subtask/?subtask_type=observation&state__value=finishing&scheduled_stop_time__gt=" + to_iso_extended_string(justnow) + "&ordering=scheduled_start_time";
+    string queryStr = "/api/subtask/?subtask_type=observation&state__value=finishing&is_using_lofar2_stations=False&scheduled_stop_time__gt=" + to_iso_extended_string(justnow) + "&ordering=scheduled_start_time";
 
     Json::Value result;
     if(httpGETAsJson(queryStr, result))
-- 
GitLab