Skip to content

Commit

Permalink
Change some property names in the Remote Query algorithms
Browse files Browse the repository at this point in the history
Change the names of the output properties for job times to match the names in the JSON data.

Refs #7946
  • Loading branch information
rgmiller committed Sep 18, 2013
1 parent 4ae755e commit f1f16a7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
38 changes: 19 additions & 19 deletions Code/Mantid/Framework/RemoteAlgorithms/src/QueryAllRemoteJobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ void QueryAllRemoteJobs::init()

// Times for job submit, job start and job complete (may be empty depending
// on the server-side implementation)
declareProperty( new ArrayProperty<std::string>("SubmitTime", nullValidator, Direction::Output));
declareProperty( new ArrayProperty<std::string>("StartTime", nullValidator, Direction::Output));
declareProperty( new ArrayProperty<std::string>("CompletionTime", nullValidator, Direction::Output));
declareProperty( new ArrayProperty<std::string>("SubmitDate", nullValidator, Direction::Output));
declareProperty( new ArrayProperty<std::string>("StartDate", nullValidator, Direction::Output));
declareProperty( new ArrayProperty<std::string>("CompletionDate", nullValidator, Direction::Output));
}

void QueryAllRemoteJobs::exec()
Expand Down Expand Up @@ -78,9 +78,9 @@ void QueryAllRemoteJobs::exec()
std::vector<std::string> jobNames;
std::vector<std::string> scriptNames;
std::vector<std::string> transIds;
std::vector<std::string> submitTimes;
std::vector<std::string> startTimes;
std::vector<std::string> completionTimes;
std::vector<std::string> submitDates;
std::vector<std::string> startDates;
std::vector<std::string> completionDates;

JSONObject::const_iterator it = resp.begin();
while (it != resp.end())
Expand All @@ -106,24 +106,24 @@ void QueryAllRemoteJobs::exec()
// The time stuff is actually an optional extension. We could check the info
// URL and see if the server implements it, but it's easier to just look in
// the output and see if the values are there...
if (jobData.find( "SubmitTime") != jobData.end())
if (jobData.find( "SubmitDate") != jobData.end())
{
jobData["SubmitTime"].getValue( value);
submitTimes.push_back( value);
jobData["SubmitDate"].getValue( value);
submitDates.push_back( value);

jobData["StartTime"].getValue( value);
startTimes.push_back( value);
jobData["StartDate"].getValue( value);
startDates.push_back( value);

jobData["CompletionTime"].getValue( value);
completionTimes.push_back( value);
jobData["CompletionDate"].getValue( value);
completionDates.push_back( value);
}
else
{
// push back empty strings just so all the array properties have the same
// number of elements
submitTimes.push_back( "");
startTimes.push_back( "");
completionTimes.push_back( "");
submitDates.push_back( "");
startDates.push_back( "");
completionDates.push_back( "");
}

it++;
Expand All @@ -134,9 +134,9 @@ void QueryAllRemoteJobs::exec()
setProperty( "JobName", jobNames);
setProperty( "ScriptName", scriptNames);
setProperty( "TransID", transIds);
setProperty( "SubmitTime", submitTimes);
setProperty( "StartTime", startTimes);
setProperty( "CompletionTime", completionTimes);
setProperty( "SubmitDate", submitDates);
setProperty( "StartDate", startDates);
setProperty( "CompletionDate", completionDates);

}
else
Expand Down
24 changes: 12 additions & 12 deletions Code/Mantid/Framework/RemoteAlgorithms/src/QueryRemoteJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ void QueryRemoteJob::init()
// Transaction ID this job is associated with
declareProperty( "TransID", "", nullValidator, "", Direction::Output);

// Times for job submit, job start and job complete (may be empty depending
// on the server-side implementation)
declareProperty( "SubmitTime", "", nullValidator, "", Direction::Output);
declareProperty( "StartTime", "", nullValidator, "", Direction::Output);
declareProperty( "CompletionTime", "", nullValidator, "", Direction::Output);
// Dates and times for job submit, job start and job complete (may be empty
// depending on the server-side implementation)
declareProperty( "SubmitDate", "", nullValidator, "", Direction::Output);
declareProperty( "StartDate", "", nullValidator, "", Direction::Output);
declareProperty( "CompletionDate", "", nullValidator, "", Direction::Output);

}

Expand Down Expand Up @@ -98,16 +98,16 @@ void QueryRemoteJob::exec()
// The time stuff is actually an optional extension. We could check the info
// URL and see if the server implements it, but it's easier to just look in
// the output and see if the values are there...
if (status.find( "SubmitTime") != status.end())
if (status.find( "SubmitDate") != status.end())
{
status["SubmitTime"].getValue( value);
setProperty( "SubmitTime", value);
status["SubmitDate"].getValue( value);
setProperty( "SubmitDate", value);

status["StartTime"].getValue( value);
setProperty( "StartTime", value);
status["StartDate"].getValue( value);
setProperty( "StartDate", value);

status["CompletionTime"].getValue( value);
setProperty( "CompletionTime", value);
status["CompletionDate"].getValue( value);
setProperty( "CompletionDate", value);
}
}
else
Expand Down

0 comments on commit f1f16a7

Please sign in to comment.