private void dICOMEchoToolStripMenuItem_Click(object sender, EventArgs e) { string detailedEchoFileName = ""; if (registeredPeersGrid.SelectedIndices.Count > 0) { int selectedIndex = registeredPeersGrid.SelectedIndices[0]; //isStorageEcho = true; allThreadsFinished = false; if ((peers[selectedIndex].IP == null) || (peers[selectedIndex].IP.Length == 0)) { MessageBox.Show("Pl Specify SCP IP Address.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //Update DVT & SUT settings OverviewThread overviewThread = new OverviewThread(); overviewThread.Initialize(threadManager); overviewThread.Options.DeepCopyFrom(options); overviewThread.Options.Identifier = "Move_Destinations"; overviewThread.Options.AttachChildsToUserInterfaces = true; overviewThread.Options.LogThreadStartingAndStoppingInParent = false; overviewThread.Options.LogWaitingForCompletionChildThreads = false; String resultsFileName = "MoveDestinations_" + System.DateTime.Now.ToString("yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture); overviewThread.Options.ResultsFileNameOnlyWithoutExtension = resultsFileName; SCU echoScu = new SCU(); echoScu.Initialize(overviewThread); echoScu.Options.DeepCopyFrom(options); String resultsFileBaseName = "MoveDestinationsEcho_" + System.DateTime.Now.ToString("yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture); echoScu.Options.ResultsFileNameOnlyWithoutExtension = resultsFileBaseName; echoScu.Options.Identifier = resultsFileBaseName; echoScu.Options.LogThreadStartingAndStoppingInParent = false; echoScu.Options.LogWaitingForCompletionChildThreads = false; echoScu.Options.AutoValidate = false; echoScu.Options.ResultsDirectory = options.ResultsDirectory; //echoScu.Options.LocalAeTitle ="SCU"; echoScu.Options.RemoteAeTitle = peers[selectedIndex].AE; echoScu.Options.RemotePort = peers[selectedIndex].Port; echoScu.Options.RemoteHostName = peers[selectedIndex].IP; //this.userControlActivityLogging.Attach(echoScu); detailedEchoFileName = echoScu.Options.DetailResultsFullFileName; PresentationContext presentationContext = new PresentationContext("1.2.840.10008.1.1", // Abstract Syntax Name "1.2.840.10008.1.2"); // Transfer Syntax Name(s) PresentationContext[] presentationContexts = new PresentationContext[1]; presentationContexts[0] = presentationContext; DvtkHighLevelInterface.Dicom.Messages.DicomMessage echoMessage = new DvtkHighLevelInterface.Dicom.Messages.DicomMessage(DvtkData.Dimse.DimseCommand.CECHORQ); echoScu.Start(); bool sendResult = echoScu.TriggerSendAssociationAndWait(echoMessage, presentationContexts); if (!sendResult) { MessageBox.Show("DICOM Echo failed ","Failed",MessageBoxButtons.OK,MessageBoxIcon.Error); } else MessageBox.Show("DICOM Echo successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); echoScu.Stop(); if (OnShowEchoResults != null) { OnShowEchoResults.Invoke(detailedEchoFileName,sendResult); } allThreadsFinished=false; } }
private void dICOMEchoToolStripMenuItem_Click(object sender, EventArgs e) { string detailedEchoFileName = ""; if (registeredPeersGrid.SelectedIndices.Count > 0) { int selectedIndex = registeredPeersGrid.SelectedIndices[0]; //isStorageEcho = true; allThreadsFinished = false; if ((peers[selectedIndex].IP == null) || (peers[selectedIndex].IP.Length == 0)) { MessageBox.Show("Pl Specify SCP IP Address.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //Update DVT & SUT settings OverviewThread overviewThread = new OverviewThread(); overviewThread.Initialize(threadManager); overviewThread.Options.DeepCopyFrom(options); overviewThread.Options.Identifier = "Move_Destinations"; overviewThread.Options.AttachChildsToUserInterfaces = true; overviewThread.Options.LogThreadStartingAndStoppingInParent = false; overviewThread.Options.LogWaitingForCompletionChildThreads = false; String resultsFileName = "MoveDestinations_" + System.DateTime.Now.ToString("yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture); overviewThread.Options.ResultsFileNameOnlyWithoutExtension = resultsFileName; SCU echoScu = new SCU(); echoScu.Initialize(overviewThread); echoScu.Options.DeepCopyFrom(options); String resultsFileBaseName = "MoveDestinationsEcho_" + System.DateTime.Now.ToString("yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture); echoScu.Options.ResultsFileNameOnlyWithoutExtension = resultsFileBaseName; echoScu.Options.Identifier = resultsFileBaseName; echoScu.Options.LogThreadStartingAndStoppingInParent = false; echoScu.Options.LogWaitingForCompletionChildThreads = false; echoScu.Options.AutoValidate = false; echoScu.Options.ResultsDirectory = options.ResultsDirectory; //echoScu.Options.LocalAeTitle ="SCU"; echoScu.Options.RemoteAeTitle = peers[selectedIndex].AE; echoScu.Options.RemotePort = peers[selectedIndex].Port; echoScu.Options.RemoteHostName = peers[selectedIndex].IP; //this.userControlActivityLogging.Attach(echoScu); detailedEchoFileName = echoScu.Options.DetailResultsFullFileName; PresentationContext presentationContext = new PresentationContext("1.2.840.10008.1.1", // Abstract Syntax Name "1.2.840.10008.1.2"); // Transfer Syntax Name(s) PresentationContext[] presentationContexts = new PresentationContext[1]; presentationContexts[0] = presentationContext; DvtkHighLevelInterface.Dicom.Messages.DicomMessage echoMessage = new DvtkHighLevelInterface.Dicom.Messages.DicomMessage(DvtkData.Dimse.DimseCommand.CECHORQ); echoScu.Start(); bool sendResult = echoScu.TriggerSendAssociationAndWait(echoMessage, presentationContexts); if (!sendResult) { MessageBox.Show("DICOM Echo failed ", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("DICOM Echo successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } echoScu.Stop(); if (OnShowEchoResults != null) { OnShowEchoResults.Invoke(detailedEchoFileName, sendResult); } allThreadsFinished = false; } }