Index: BasicGrayscalePrintScu.cs =================================================================== --- BasicGrayscalePrintScu.cs (revision 10084) +++ BasicGrayscalePrintScu.cs (working copy) @@ -44,53 +44,36 @@ /// /// /// imageBoxPixelModuleIods = new List(); /// /// // Configure 1st Image /// ImageBoxPixelModuleIod imageBoxPixelModuleIod = new ImageBoxPixelModuleIod(); /// imageBoxPixelModuleIod.ImageBoxPosition = 1; - /// imageBoxPixelModuleIod.Polarity = Polarity.Normal; - /// imageBoxPixelModuleIod.MagnificationType = MagnificationType.Bilinear; - /// imageBoxPixelModuleIod.RequestedDecimateCropBehavior = DecimateCropBehavior.Crop; - /// imageBoxPixelModuleIod.SmoothingType = SmoothingType.None; - /// BasicGrayscaleImageSequenceIod basicGrayscaleImageSequence = new BasicGrayscaleImageSequenceIod(); - /// string fileName = @""; // TODO: put file name here - /// basicGrayscaleImageSequence.AddDicomFileValues(fileName); + + /// // Add grayscale image sequence and add the file + /// var basicGrayscaleImageSequence = new BasicGrayscaleImageSequenceIod(); + /// basicGrayscaleImageSequence.AddDicomFileValues(file1); /// imageBoxPixelModuleIod.BasicGrayscaleImageSequenceList.Add(basicGrayscaleImageSequence); /// imageBoxPixelModuleIods.Add(imageBoxPixelModuleIod); - /// - /// // Configure 2nd image - /// imageBoxPixelModuleIod = new ImageBoxPixelModuleIod(); - /// imageBoxPixelModuleIod.ImageBoxPosition = 2; - /// imageBoxPixelModuleIod.Polarity = Polarity.Normal; - /// imageBoxPixelModuleIod.MagnificationType = MagnificationType.Bilinear; - /// imageBoxPixelModuleIod.RequestedDecimateCropBehavior = DecimateCropBehavior.Crop; - /// imageBoxPixelModuleIod.SmoothingType = SmoothingType.None; - /// basicGrayscaleImageSequence = new BasicGrayscaleImageSequenceIod(); - /// fileName = @""; // TODO: put 2nd file name here - /// basicGrayscaleImageSequence.AddDicomFileValues(fileName); - /// imageBoxPixelModuleIod.BasicGrayscaleImageSequenceList.Add(basicGrayscaleImageSequence); - /// imageBoxPixelModuleIods.Add(imageBoxPixelModuleIod); - /// - /// BasicGrayscalePrintScu printScu = new BasicGrayscalePrintScu(); - /// printScu.Print("MYCLIENTAETITLE", "MYSERVERAE", "127.0.0.1", 5678, basicFilmSessionModuleIod, basicFilmBoxModuleIod, imageBoxPixelModuleIods); + + /// DicomState expected = DicomState.Success; + /// DicomState actual = printScu.Print(clientAETitle, remoteAE, remoteHost, remotePort, + /// basicFilmSessionModuleIod, basicFilmBoxModuleIod, imageBoxPixelModuleIods); + /// } /// ]]> /// /// @@ -201,7 +184,7 @@ /// Initializes a new instance of the class. /// public BasicGrayscalePrintScu() - :base() + : base() { } #endregion @@ -229,6 +212,9 @@ _currentImageBoxIndex = 0; _filmBoxUids.Clear(); Connect(clientAETitle, remoteAE, remoteHost, remotePort); + if (Status == ScuOperationStatus.AssociationRejected || Status == ScuOperationStatus.Failed || Status == ScuOperationStatus.ConnectFailed || + Status == ScuOperationStatus.NetworkError || Status == ScuOperationStatus.TimeoutExpired) + return DicomState.Failure; return ResultStatus; } @@ -465,7 +451,7 @@ break; } } - else + else { // TODO: Handle this... check for warnings - they are OK? throw exception on errors... ? }