From 11a510ec6761cd8359d31186a23820ffd54e5542 Mon Sep 17 00:00:00 2001
From: Ruud Overeem <overeem@astron.nl>
Date: Wed, 29 Nov 2006 22:09:26 +0000
Subject: [PATCH] BugID: 796 PVSS related enhancements.

---
 MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
index cea521d4ad0..121a42c8b4d 100644
--- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
@@ -586,7 +586,7 @@ void MACScheduler::_addActiveObservation(const Observation&	newObs)
 
 	// update own admin and PVSS datapoint
 	itsObservations.push_back(newObs);
-	itsPVSSObsList.push_back(new GCFPVString(newObs.name));
+	itsPVSSObsList.push_back(new GCFPVString(formatString("Observation%d", newObs.treeID)));
 	itsPropertySet->setValue(PN_MS_ACTIVE_OBSERVATIONS, GCFPVDynArr(LPT_STRING, itsPVSSObsList));
 
 	LOG_DEBUG_STR("Added observation " << newObs.name << " to active observation-list");
@@ -600,12 +600,14 @@ void MACScheduler::_addActiveObservation(const Observation&	newObs)
 void MACScheduler::_removeActiveObservation(const string& name)
 {
 	// search observation.
+	OTDB::treeIDType		treeID;
 	vector<Observation>::iterator	end  = itsObservations.end();
 	vector<Observation>::iterator	iter = itsObservations.begin();
 	bool	found(false);
 	while (!found && (iter != end)) {
 		if (iter->name == name) {
 			found = true;
+			treeID = iter->treeID;
 			itsObservations.erase(iter);
 			LOG_DEBUG_STR("Removed observation " << name << " from active observationList");
 		}
@@ -616,10 +618,11 @@ void MACScheduler::_removeActiveObservation(const string& name)
 		return;
 	}
 
+	string		obsName(formatString("Observation%d", treeID));
 	GCFPValueArray::iterator	pEnd  = itsPVSSObsList.end();
 	GCFPValueArray::iterator	pIter = itsPVSSObsList.begin();
 	while (pIter != pEnd) {
-		if ((static_cast<GCFPVString*>(*pIter))->getValue() == name) {
+		if ((static_cast<GCFPVString*>(*pIter))->getValue() == obsName) {
 			delete 	*pIter;
 			itsPVSSObsList.erase(pIter);
 			break;
-- 
GitLab