comparison Core/JobsEngine/JobInfo.cpp @ 2647:73d7d95dd75e jobs

removal of internal job information
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 31 May 2018 17:45:09 +0200
parents 7b72061157b1
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2646:740983056f9e 2647:73d7d95dd75e
117 throw OrthancException(ErrorCode_BadSequenceOfCalls); 117 throw OrthancException(ErrorCode_BadSequenceOfCalls);
118 } 118 }
119 } 119 }
120 120
121 121
122 void JobInfo::Serialize(Json::Value& target, 122 void JobInfo::Format(Json::Value& target) const
123 bool includeInternalContent) const
124 { 123 {
125 target = Json::objectValue; 124 target = Json::objectValue;
126 target["ID"] = id_; 125 target["ID"] = id_;
127 target["Priority"] = priority_; 126 target["Priority"] = priority_;
128 target["ErrorCode"] = static_cast<int>(status_.GetErrorCode()); 127 target["ErrorCode"] = static_cast<int>(status_.GetErrorCode());
132 target["CreationTime"] = boost::posix_time::to_iso_string(creationTime_); 131 target["CreationTime"] = boost::posix_time::to_iso_string(creationTime_);
133 target["EffectiveRuntime"] = static_cast<double>(runtime_.total_milliseconds()) / 1000.0; 132 target["EffectiveRuntime"] = static_cast<double>(runtime_.total_milliseconds()) / 1000.0;
134 target["Progress"] = boost::math::iround(status_.GetProgress() * 100.0f); 133 target["Progress"] = boost::math::iround(status_.GetProgress() * 100.0f);
135 134
136 target["Type"] = status_.GetJobType(); 135 target["Type"] = status_.GetJobType();
137 target["PublicContent"] = status_.GetPublicContent(); 136 target["Content"] = status_.GetPublicContent();
138
139 if (includeInternalContent)
140 {
141 target["InternalContent"] = status_.GetInternalContent();
142 }
143 137
144 if (HasEstimatedTimeOfArrival()) 138 if (HasEstimatedTimeOfArrival())
145 { 139 {
146 target["EstimatedTimeOfArrival"] = boost::posix_time::to_iso_string(GetEstimatedTimeOfArrival()); 140 target["EstimatedTimeOfArrival"] = boost::posix_time::to_iso_string(GetEstimatedTimeOfArrival());
147 } 141 }