comparison OrthancServer/ServerEnumerations.cpp @ 2335:174c3616ab6d

code review
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 17 Jul 2017 10:25:25 +0200
parents ae6245053bcf
children 3ab96768d144
comparison
equal deleted inserted replaced
2334:dd26536454a0 2335:174c3616ab6d
380 380
381 381
382 382
383 ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer) 383 ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer)
384 { 384 {
385 ModalityManufacturer result;
386 bool obsolete = false;
387
385 if (manufacturer == "Generic") 388 if (manufacturer == "Generic")
386 { 389 {
387 return ModalityManufacturer_Generic; 390 return ModalityManufacturer_Generic;
388 } 391 }
389 else if (manufacturer == "GenericNoWildcardInDates") 392 else if (manufacturer == "GenericNoWildcardInDates")
408 } 411 }
409 else if (manufacturer == "Vitrea") 412 else if (manufacturer == "Vitrea")
410 { 413 {
411 return ModalityManufacturer_Vitrea; 414 return ModalityManufacturer_Vitrea;
412 } 415 }
413 else if (manufacturer == "AgfaImpax" || manufacturer == "SyngoVia") 416 else if (manufacturer == "AgfaImpax" ||
414 { 417 manufacturer == "SyngoVia")
415 LOG(WARNING) << "The " << manufacturer << " manufacturer is obsolete since Orthanc 1.2.1. To guarantee compatibility with future Orthanc version, you should use \"GenericNoWildcardInDates\" instead in your configuration file."; 418 {
416 return ModalityManufacturer_GenericNoWildcardInDates; 419 result = ModalityManufacturer_GenericNoWildcardInDates;
417 } 420 obsolete = true;
418 else if (manufacturer == "EFilm2" || manufacturer == "MedInria") 421 }
419 { 422 else if (manufacturer == "EFilm2" ||
420 LOG(WARNING) << "The " << manufacturer << " manufacturer is obsolete since Orthanc 1.2.1. To guarantee compatibility with future Orthanc version, you should remove it from your configuration file."; 423 manufacturer == "MedInria")
421 424 {
422 return ModalityManufacturer_Generic; 425 result = ModalityManufacturer_Generic;
426 obsolete = true;
423 } 427 }
424 else 428 else
425 { 429 {
426 throw OrthancException(ErrorCode_ParameterOutOfRange); 430 throw OrthancException(ErrorCode_ParameterOutOfRange);
427 } 431 }
432
433 if (obsolete)
434 {
435 LOG(WARNING) << "The \"" << manufacturer << "\" manufacturer is obsolete since "
436 << "Orthanc 1.2.1. To guarantee compatibility with future Orthanc "
437 << "releases, you should replace it by \""
438 << EnumerationToString(result)
439 << "\" in your configuration file.";
440 }
441
442 return result;
428 } 443 }
429 444
430 445
431 const char* EnumerationToString(TransferSyntax syntax) 446 const char* EnumerationToString(TransferSyntax syntax)
432 { 447 {