Skip to content
Snippets Groups Projects
Commit 16e73e93 authored by Ruud Overeem's avatar Ruud Overeem
Browse files

Task #3571: MACScheduler uses modificationDate. Modifying an already scheduled...

Task #3571: MACScheduler uses modificationDate. Modifying an already scheduled tree will immediately result in a new parsetfile for that observation/pipeline.
parent 9db94fd1
No related branches found
No related tags found
No related merge requests found
......@@ -373,7 +373,7 @@ GCFEvent::TResult MACScheduler::active_state(GCFEvent& event, GCFPortInterface&
// claim was successful, update admin
LOG_INFO_STR("Observation " << obsID << " is mapped to " << cmEvent.DPname);
LOG_DEBUG_STR("PVSS preparation of observation " << obsID << " ready.");
itsPreparedObs[obsID] = true;
itsPreparedObs[obsID].prepReady = true;
}
break;
......@@ -620,6 +620,7 @@ void MACScheduler::_updatePlannedList()
// construct name and timings info for observation
treeIDType obsID = plannedDBlist[idx].treeID();
string obsName(observationName(obsID));
ptime modTime = plannedDBlist[idx].modificationDate;
// remove obs from backup of the planned-list (it is in the list again)
OLiter oldObsIter = backupObsList.find(obsID);
......@@ -629,7 +630,8 @@ void MACScheduler::_updatePlannedList()
// must we claim this observation at the claimMgr?
OLiter prepIter = itsPreparedObs.find(obsID);
if ((prepIter == itsPreparedObs.end()) || (prepIter->second == false)) {
if ((prepIter == itsPreparedObs.end()) || (prepIter->second.prepReady == false) ||
(prepIter->second.modTime != modTime)) {
// create a ParameterFile for this Observation
TreeMaintenance tm(itsOTDBconnection);
OTDBnode topNode = tm.getTopNode(obsID);
......@@ -642,7 +644,7 @@ void MACScheduler::_updatePlannedList()
// Claim a DP in PVSS and write obssettings to it so the operator can see it.
LOG_DEBUG_STR("Requesting preparation of PVSS for " << obsName);
itsClaimerTask->prepareObservation(obsName);
itsPreparedObs[obsID] = false; // requested claim but no answer yet.
itsPreparedObs[obsID] = schedInfo(modTime, false); // requested claim but no answer yet.
}
}
else {
......@@ -655,7 +657,7 @@ void MACScheduler::_updatePlannedList()
int timeBeforeStart = time_duration(plannedDBlist[idx].starttime - currentTime).total_seconds();
// LOG_DEBUG_STR(obsName << " starts over " << timeBeforeStart << " seconds");
if (timeBeforeStart > 0 && timeBeforeStart <= (int)itsQueuePeriod) {
if (itsPreparedObs[obsID] == false) {
if (itsPreparedObs[obsID].prepReady == false) {
LOG_ERROR_STR("Observation " << obsID << " must be started but is not claimed yet.");
}
else {
......
......@@ -122,8 +122,15 @@ private:
// Define a list in which we keep the obsID's of the observations we prepared PVSS for.
// When an obs is in the list we at least have sent a claim request to PVSS. When the
// second value it true we succeeded the claim and we don't have to claim it again.
typedef map<int /*obsID*/, bool /*prepReady*/> ObsList;
typedef map<int ,bool>::iterator OLiter;
class schedInfo {
public:
ptime modTime;
bool prepReady;
schedInfo(ptime t, bool p) : modTime(t), prepReady(p) {};
schedInfo() : modTime(min_date_time), prepReady(false) {};
};
typedef map<int /*obsID*/, schedInfo /*prepReady*/> ObsList;
typedef map<int ,schedInfo>::iterator OLiter;
ObsList itsPreparedObs; // Observations we already prepared PVSS for.
// Ports for StartDaemon and ObservationControllers.
......
......@@ -1215,6 +1215,17 @@ create_cpp_headerfile()
echo "#endif" >>${DESTDIR}/${CPP_HEADERFILE}
}
check_start_dir()
{
if [ -f PVSSbase.dpdef ]; then
return
else
echo "Start create_db_files from the directory with the PVSS datafiles"
echo "Start with ../bin/create_db_files [options]"
echo
exit
fi
}
#------------------------------ MAIN program ------------------------------
#
# Syntax: create_db_files [-d destdir] [-s station | -C]
......@@ -1278,8 +1289,9 @@ elif [ "$DBTYPE" == "M" ]; then
cd $DESTDIR
echo "Making files for $STNNAME in $DESTDIR"
else
configdir=".."
dpdefdir=""
check_start_dir
configdir="../../"
dpdefdir="../data/"
fi
elif [ "$DBTYPE" == "C" ]; then
if [ "$HOSTNAME" == "CCU001" -o "$HOSTNAME" == "CCU099" ]; then
......@@ -1290,12 +1302,14 @@ elif [ "$DBTYPE" == "C" ]; then
cd $DESTDIR
echo "Making files for $STNNAME in $DESTDIR"
else
configdir=".."
dpdefdir=""
check_start_dir
configdir="../../"
dpdefdir="../data/"
fi
else
configdir=".."
dpdefdir=""
check_start_dir
configdir="../.."
dpdefdir="../data"
STNNAME=$DBTYPENAME
fi
......@@ -1306,12 +1320,12 @@ if [ ! -f $STATIONINFOFILE ]; then
exit
fi
COMPONENT_FILE=${dpdefdir}PVSSbase.dpdef
CLUSTERFILE=${dpdefdir}Clusters.list
RINGFILE=${dpdefdir}Rings.list
WANFILE=${dpdefdir}Wan.list
COMPONENT_FILE=${dpdefdir}/PVSSbase.dpdef
CLUSTERFILE=${dpdefdir}/Clusters.list
RINGFILE=${dpdefdir}/Rings.list
WANFILE=${dpdefdir}/Wan.list
ERRORFILE=/tmp/Crea.Error
INPUTFILE=${dpdefdir}PVSSDataPoints.base
INPUTFILE=${dpdefdir}/PVSSDataPoints.base
# define the output files
CPP_HEADERFILE=PVSSDatapointDefs.h
......
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