comparison Applications/Samples/SimpleViewerApplicationSingleFile.h @ 411:3aa058dcd5fb

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 12 Nov 2018 16:07:42 +0100
parents 5d359b115b29
children aee3d7941c9b
comparison
equal deleted inserted replaced
410:6decc0ba9da5 411:3aa058dcd5fb
336 336
337 void OnStudyListReceived(const OrthancApiClient::JsonResponseReadyMessage& message) 337 void OnStudyListReceived(const OrthancApiClient::JsonResponseReadyMessage& message)
338 { 338 {
339 const Json::Value& response = message.GetJson(); 339 const Json::Value& response = message.GetJson();
340 340
341 if (response.isArray() && response.size() > 1) 341 if (response.isArray() &&
342 response.size() >= 1)
342 { 343 {
343 SelectStudy(response[0].asString()); 344 SelectStudy(response[0].asString());
344 } 345 }
345 } 346 }
347
346 void OnStudyReceived(const OrthancApiClient::JsonResponseReadyMessage& message) 348 void OnStudyReceived(const OrthancApiClient::JsonResponseReadyMessage& message)
347 { 349 {
348 const Json::Value& response = message.GetJson(); 350 const Json::Value& response = message.GetJson();
349 351
350 if (response.isObject() && response["Series"].isArray()) 352 if (response.isObject() && response["Series"].isArray())
400 thumbnailWidget->SetInteractor(*thumbnailInteractor_); 402 thumbnailWidget->SetInteractor(*thumbnailInteractor_);
401 } 403 }
402 404
403 void SelectStudy(const std::string& studyId) 405 void SelectStudy(const std::string& studyId)
404 { 406 {
407 LOG(INFO) << "Selecting study: " << studyId;
405 orthancApiClient_->GetJsonAsync("/studies/" + studyId, new Callable<SimpleViewerApplication, OrthancApiClient::JsonResponseReadyMessage>(*this, &SimpleViewerApplication::OnStudyReceived)); 408 orthancApiClient_->GetJsonAsync("/studies/" + studyId, new Callable<SimpleViewerApplication, OrthancApiClient::JsonResponseReadyMessage>(*this, &SimpleViewerApplication::OnStudyReceived));
406 } 409 }
407 410
408 void OnWidgetGeometryChanged(const SliceViewerWidget::GeometryChangedMessage& message) 411 void OnWidgetGeometryChanged(const SliceViewerWidget::GeometryChangedMessage& message)
409 { 412 {