Mercurial > hg > orthanc
comparison Core/Enumerations.cpp @ 2646:740983056f9e jobs
StringToJobState
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 31 May 2018 17:30:22 +0200 |
parents | 8da2cffc2378 |
children | 193ef9c1b731 |
comparison
equal
deleted
inserted
replaced
2644:5b3bfdf6b790 | 2646:740983056f9e |
---|---|
1462 throw OrthancException(ErrorCode_ParameterOutOfRange); | 1462 throw OrthancException(ErrorCode_ParameterOutOfRange); |
1463 } | 1463 } |
1464 } | 1464 } |
1465 | 1465 |
1466 | 1466 |
1467 JobState StringToJobState(const std::string& state) | |
1468 { | |
1469 if (state == "Pending") | |
1470 { | |
1471 return JobState_Pending; | |
1472 } | |
1473 else if (state == "Running") | |
1474 { | |
1475 return JobState_Running; | |
1476 } | |
1477 else if (state == "Success") | |
1478 { | |
1479 return JobState_Success; | |
1480 } | |
1481 else if (state == "Failure") | |
1482 { | |
1483 return JobState_Failure; | |
1484 } | |
1485 else if (state == "Paused") | |
1486 { | |
1487 return JobState_Paused; | |
1488 } | |
1489 else if (state == "Retry") | |
1490 { | |
1491 return JobState_Retry; | |
1492 } | |
1493 else | |
1494 { | |
1495 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
1496 } | |
1497 } | |
1498 | |
1499 | |
1467 unsigned int GetBytesPerPixel(PixelFormat format) | 1500 unsigned int GetBytesPerPixel(PixelFormat format) |
1468 { | 1501 { |
1469 switch (format) | 1502 switch (format) |
1470 { | 1503 { |
1471 case PixelFormat_Grayscale8: | 1504 case PixelFormat_Grayscale8: |