[IGSTK-Users] Error handling in igstk applications
Torleif Sandnes
Torleif.Sandnes at sintef.no
Tue Jun 26 03:57:43 EDT 2007
Hi.
I am building an application that has to read Dicom images and want
to listen for all error events that the imagereader can send. Based
on the error, I want to provide a message to the user describing the
error.
Using igstkEventTransductionMacro, I could add a state to my
imagereader component for every errorevent from igstk::DicomImageReader:
DICOMInvalidRequestErrorEvent
DICOMImageDirectoryEmptyErrorEvent
DICOMImageDirectoryDoesNotExistErrorEvent
DICOMImageDirectoryIsNotDirectoryErrorEvent
DICOMImageDirectoryDoesNotHaveEnoughFilesErrorEvent
DICOMImageSeriesFileNamesGeneratingErrorEvent
DICOMImageReadingErrorEvent
This would introduce seven new states and (at least) seven new
transitions. All I want to do with these events is to convert it into
a message to the user, so each transition's processing method would
do essentially the same thing. This seems to be adding a lot of
complexity to my statemachine to accomplish just a little.
Ideally, I would like to add only one "imagereading failed" state to
my component and be able to differentiate between the events. Is this
possible?
Regards,
Torleif Sandnes
Sintef Health Research
More information about the IGSTK-Users
mailing list