예제 #1
0
파일: ResultsFile.cs 프로젝트: ewcasas/DVTK
 public static void BackupFiles(Dvtk.Sessions.Session theSession, ArrayList theFilesToBackup)
 {
     foreach (string theFileToBackup in theFilesToBackup)
     {
         BackupFile(theSession, theFileToBackup);
     }
 }
예제 #2
0
파일: Map.cs 프로젝트: ewcasas/DVTK
        // -------------------------------
        // - Begin public methods region -
        // -------------------------------
        /// <summary>
        /// Convert a HLI Attribute Set to a AttributeLayer Attribute Set.
        /// </summary>
        /// <param name="attributeSetIn">The HLI Attribute Set.</param>
        /// <param name="attributeSetOut">The AttributeLayer Attribute Set.</param>
        public static void ToAttributeSet(DvtkHighLevelInterface.Dicom.Other.AttributeSet attributeSetIn, Dvtk.Dicom.AttributeLayer.AttributeSet attributeSetOut)
        {
            for (int index = 0; index < attributeSetIn.Count; index++)
            {
                DvtkHighLevelInterface.Dicom.Other.Attribute hliAttribute = attributeSetIn[index];

                Tag tag = new Tag(hliAttribute.GroupNumber, hliAttribute.ElementNumber);

                if (hliAttribute.VR != DvtkData.Dimse.VR.SQ)
                {
                    SingleAttribute singleAttribute = new SingleAttribute(tag, (VR)Enum.Parse(typeof(VR), hliAttribute.VR.ToString(), true), attributeSetOut);
                }
                else
                {
                    SequenceAttribute sequenceAttribute = new SequenceAttribute(tag, attributeSetOut);

                    for (int sequenceItemIndex = 1; sequenceItemIndex <= hliAttribute.ItemCount; sequenceItemIndex++)
                    {
                        DvtkHighLevelInterface.Dicom.Other.SequenceItem hliSequenceItem = hliAttribute.GetItem(sequenceItemIndex);

                        SequenceItem sequenceItem = new SequenceItem(sequenceAttribute);

                        ToAttributeSet(hliSequenceItem, sequenceItem);
                    }
                }
            }
        }
예제 #3
0
파일: ResultsFile.cs 프로젝트: ewcasas/DVTK
        public static ArrayList GetAllNamesForSession(Dvtk.Sessions.Session theSession)
        {
            ArrayList theResultsFiles = new ArrayList();
            DirectoryInfo theDirectoryInfo;
            FileInfo[] theFilesInfo;

            theDirectoryInfo = new DirectoryInfo (theSession.ResultsRootDirectory);

            if (theDirectoryInfo.Exists)
            {
                theFilesInfo = theDirectoryInfo.GetFiles ("*.xml");

                foreach (FileInfo theFileInfo in theFilesInfo)
                {
                    string theResultsFileName = theFileInfo.Name;

                    if (IsValid(theResultsFileName))
                    {
                        theResultsFiles.Add(theResultsFileName);
                    }
                }
            }

            return theResultsFiles;
        }
예제 #4
0
        public SelectTransferSyntaxesForm(Dvtk.Sessions.EmulatorSession session)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this._session = session;
            ts_list = new ArrayList();
            ts_list.Add (DvtkData.Dul.TransferSyntax.Implicit_VR_Little_Endian);
            ts_list.Add (DvtkData.Dul.TransferSyntax.Explicit_VR_Big_Endian);
            ts_list.Add (DvtkData.Dul.TransferSyntax.Explicit_VR_Little_Endian);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Baseline_Process_1);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Extended_Hierarchical_16_And_18);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Extended_Hierarchical_17_And_19);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Extended_Process_2_And_4);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Extended_Process_3_And_5);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Full_Progression_Hierarchical_24_And_26);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Full_Progression_Hierarchical_25_And_27);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Full_Progression_Non_Hierarchical_10_And_12);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Full_Progression_Non_Hierarchical_11_And_13);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Lossless_Hierarchical_28);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Lossless_Hierarchical_29);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Lossless_Non_Hierarchical_14);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Lossless_Non_Hierarchical_15);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Lossless_Non_Hierarchical_1st_Order_Prediction);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_LS_Lossless_Image_Compression);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_LS_Lossy_Image_Compression);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_2000_IC_Lossless_Only);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_2000_IC);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Spectral_Selection_Hierarchical_20_And_22);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Spectral_Selection_Hierarchical_21_And_23);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Spectral_Selection_Non_Hierarchical_6_And_8);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_Spectral_Selection_Non_Hierarchical_7_And_9);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_2000_Multicomponent_lossless2);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPEG_2000_Multicomponent2);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPIP_Referenced);
            ts_list.Add (DvtkData.Dul.TransferSyntax.JPIP_Referenced_Deflate);
            ts_list.Add (DvtkData.Dul.TransferSyntax.MPEG2_Main_Profile_Level);
            ts_list.Add (DvtkData.Dul.TransferSyntax.RFC_2557_Mime_Encapsulation);
            ts_list.Add (DvtkData.Dul.TransferSyntax.RLE_Lossless);
            ts_list.Add (DvtkData.Dul.TransferSyntax.Deflated_Explicit_VR_Little_Endian);

            foreach (DvtkData.Dul.TransferSyntax ts in ts_list)
            {
                TreeNode node = this.TreeViewSTS.Nodes.Add (ts.ToString());
                // Set the item to 'checked' if the transfer syntax is supported by the emulator
                if (this._session.SupportedTransferSyntaxSettings.SupportedTransferSyntaxes.Contains (ts))
                {
                    node.Checked = true;
                }
            }
        }
예제 #5
0
        public PrintEmulatorStatusForm(Dvtk.Sessions.EmulatorSession emulator_session)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.session = emulator_session;

            this.TextBoxManufacturer.Text = this.session.Printer.Manufacturer;
            this.TextBoxModelName.Text = this.session.Printer.ManufacturerModelName;
            this.TextBoxPrinterName.Text = this.session.Printer.PrinterName;
            this.TextBoxSerialNumber.Text = this.session.Printer.DeviceSerialNumber;
            this.TextBoxSoftwareVersions.Text = this.session.Printer.SoftwareVersions;
            this.DateTimeCalibrationDate.Value = this.session.Printer.DateOfLastCalibration.Date;
            this.DateTimeCalibrationTime.Value = this.session.Printer.TimeOfLastCalibration.ToLocalTime ();

            // add the 3 possible Printer Status values
            this.ComboBoxPrinterStatus.Items.Add("NORMAL");
            this.ComboBoxPrinterStatus.Items.Add("WARNING");
            this.ComboBoxPrinterStatus.Items.Add("ERROR");
            string status = this.session.Printer.Status.ToString();
            foreach (object o in this.ComboBoxPrinterStatus.Items)
            {
                if (o.ToString() == status) this.ComboBoxPrinterStatus.SelectedItem = o;
            }

            string statusInfo = this.session.Printer.StatusInfo.ToString();
            foreach (string info_dt in this.session.Printer.StatusInfoDefinedTerms)
            {
                this.ComboBoxPrinterStatusInfo.Items.Add (info_dt);
            }
            foreach (object o in this.ComboBoxPrinterStatusInfo.Items)
            {
                if (o.ToString() == statusInfo) this.ComboBoxPrinterStatusInfo.SelectedItem = o;
            }
        }
예제 #6
0
파일: Session.cs 프로젝트: ewcasas/DVTK
 private ArrayList GetFileNames(Dvtk.Sessions.Session session , string detailFile )
 {
     string resultFileName = System.IO.Path.GetFileNameWithoutExtension(detailFile);
     ArrayList resultsFiles = new ArrayList();
     DirectoryInfo directoryInfo;
     FileInfo[] filesInfo;
     directoryInfo = new DirectoryInfo (session.ResultsRootDirectory);
     if (directoryInfo.Exists) {
         filesInfo = directoryInfo.GetFiles(
             resultFileName.Substring(0,resultFileName.Length - 3) + "*.xml");
         foreach (FileInfo fileInfo in filesInfo){
             resultsFiles.Add(fileInfo.Name);
         }
     }
     return resultsFiles;
 }
예제 #7
0
 public BaseInformationModel(Dvtk.Dicom.InformationEntity.BaseInformationModel root)
 {
     _root = root;
 }
예제 #8
0
파일: MainForm.cs 프로젝트: ewcasas/DVTK
        public bool IsExecuting(Dvtk.Sessions.Session theSession)
        {
            ArrayList theExecutingSessions = GetExecutingSessions();

            return(theExecutingSessions.Contains(theSession));
        }
예제 #9
0
 public DialogResult ShowDialog(IWin32Window theIWin32Window, Dvtk.Sessions.EmulatorSession theEmulatorSession)
 {
     _EmulatorSession = theEmulatorSession;
     return(ShowDialog(theIWin32Window));
 }
 //
 // - Constructors -
 //
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="exceptionText">The exception text.</param>
 /// <param name="receiveReturnCode">The receive return code indicating the reason for the exception.</param>
 public DicomProtocolMessageReceiveException(String exceptionText, Dvtk.Sessions.ReceiveReturnCode receiveReturnCode)
     : base(exceptionText)
 {
     this.receiveReturnCode = receiveReturnCode;
 }
예제 #11
0
 //
 // ctor
 //
 internal CertificateHandling(
     Dvtk.Sessions.ISecure secureSession)
 {
     this._securitySettings = secureSession.SecuritySettings;
     this._password = this._securitySettings.TlsPassword;
     this._fileName = this._securitySettings.CertificateFileName;
     // Auto load certificate file using the session settings.
     this.LoadCertificateFile(this._fileName, this._password);
 }
예제 #12
0
        public TreeNode GetSessionNode(Dvtk.Sessions.Session theSession)
        {
            TreeNode theSessionNodeToFind = null;

            foreach (TreeNode theNode in _SessionTreeView.Nodes)
            {
                if (theNode.Tag is SessionTag)
                {
                    SessionTag theSessionTag = (SessionTag)theNode.Tag;

                    if (theSessionTag._Session == theSession)
                    {
                        theSessionNodeToFind = theNode;
                        break;
                    }
                }
            }

            return(theSessionNodeToFind);
        }
예제 #13
0
        private ArrayList GetVisibleScripts(Dvtk.Sessions.Session theSession)
        {
            ArrayList theVisibleScripts = new ArrayList();
            Dvtk.Sessions.ScriptSession theScriptSession = null;
            string theScriptRootDirectory = "";
            DirectoryInfo theDirectoryInfo = null;
            FileInfo[] theFilesInfo;

            theScriptSession = (Dvtk.Sessions.ScriptSession) theSession;
            theScriptRootDirectory = theScriptSession.DicomScriptRootDirectory;
            theDirectoryInfo = new DirectoryInfo(theScriptRootDirectory);

            if (theDirectoryInfo.Exists)
            {
                theFilesInfo = theDirectoryInfo.GetFiles();

                foreach (FileInfo theFileInfo in theFilesInfo)
                {
                    bool showScriptFile = false;
                    string theFileExtension = theFileInfo.Extension.ToLower();

                    if ((theFileExtension == ".ds") && (_MainForm._UserSettings.ShowDicomScripts))
                    {
                        showScriptFile = true;
                    }
                    else if ((theFileExtension == ".dss") && (_MainForm._UserSettings.ShowDicomSuperScripts))
                    {
                        showScriptFile = true;
                    }
                    else if ((theFileExtension == ".vbs") && (_MainForm._UserSettings.ShowVisualBasicScripts))
                    {
                        showScriptFile = true;
                    }
                    else
                    {
                        showScriptFile = false;
                    }

                    if (showScriptFile)
                    {
                        theVisibleScripts.Add(theFileInfo.Name);
                    }
                }
            }

            return(theVisibleScripts);
        }
예제 #14
0
        public void UpdateSessionNodeTextMainNodeOnly(TreeNode theTreeNode, Dvtk.Sessions.Session theSession)
        {
            bool isSessionExecuting = _MainForm.IsExecuting(theSession);
            bool isSessionExecutingInOtherSessionTreeView = (isSessionExecuting && (theSession != GetExecutingSession()));

            theTreeNode.Text = System.IO.Path.GetFileName(theSession.SessionFileName);

            if ( (theSession is Dvtk.Sessions.ScriptSession) ||
                 (theSession is Dvtk.Sessions.EmulatorSession)
               )
            {
                if (isSessionExecutingInOtherSessionTreeView)
                {
                    theTreeNode.Text+= " (disabled)";
                }
            }

            if (theSession is Dvtk.Sessions.MediaSession)
            {
                // If this session is executing...
                if (isSessionExecuting)
                {
                    // If the executing session is executed by this session tree view...
                    if (theSession == GetExecutingSession())
                    {
                        theTreeNode.Text+= " (executing)";
                    }
                        // If the executing session is not executed by this session tree view...
                    else
                    {
                        theTreeNode.Text+= " (disabled)";
                    }
                }
            }

            if (_Project.GetSessionChanged(theSession))
            {
                theTreeNode.Text+= " *";
            }
        }
예제 #15
0
        /// <summary>
        /// Update a Session node.
        /// </summary>
        /// <param name="theTreeNode">The tree node to update.</param>
        /// <param name="theSession">The Session the node is representing.</param>
        public void UpdateSessionNode(TreeNode theTreeNode, Dvtk.Sessions.Session theSession, ref bool isEmpty)
        {
            isEmpty = false;

            UpdateSessionNodeTextMainNodeOnly(theTreeNode, theSession);

            if (theSession is Dvtk.Sessions.ScriptSession)
            {
                UpdateScriptSessionNode(theTreeNode, theSession, ref isEmpty);
            }

            if (theSession is Dvtk.Sessions.MediaSession)
            {
                UpdateMediaSessionNode(theTreeNode, theSession);
            }

            if (theSession is Dvtk.Sessions.EmulatorSession)
            {
                UpdateEmulatorSessionNode(theTreeNode, theSession);
            }
        }
예제 #16
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="id">Actor Id.</param>
 /// <param name="iheFramework">Ihe Framework container.</param>
 public AdtPatientRegistrationActor(System.String id, Dvtk.IheActors.IheFramework.IheFramework iheFramework)
     : base(new ActorName(ActorTypeEnum.AdtPatientRegistration, id), iheFramework)
 {
 }
예제 #17
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="id">Actor Id.</param>
 /// <param name="iheFramework">Ihe Framework container.</param>
 public PpsManagerActor(System.String id, Dvtk.IheActors.IheFramework.IheFramework iheFramework)
     : base(new ActorName(ActorTypeEnum.PerformedProcedureStepManager, id), iheFramework)
 {
 }
예제 #18
0
        public void UpdateEmulatorNode(TreeNode theEmulatorTreeNode, Dvtk.Sessions.Session theSession, ArrayList theResultsFiles, EmulatorTag.EmulatorType theEmulatorType, bool isExecuting)
        {
            // Set the text on this session tree node.
            switch(theEmulatorType)
            {
                case EmulatorTag.EmulatorType.PRINT_SCP:
                {
                    theEmulatorTreeNode.Text = "Print SCP Emulator";
                }
                break;

                case EmulatorTag.EmulatorType.STORAGE_SCP:
                {
                    theEmulatorTreeNode.Text = "Storage SCP Emulator";
                }
                break;

                case EmulatorTag.EmulatorType.STORAGE_SCU:
                {
                    theEmulatorTreeNode.Text = "Storage SCU Emulator";
                }
                break;
            }

            if (isExecuting)
            {
                theEmulatorTreeNode.Text += " (executing)";
            }

            // Set the tag for this session tree node.
            EmulatorTag theEmulatorTag = new EmulatorTag(theSession, theEmulatorType);
            theEmulatorTreeNode.Tag = theEmulatorTag;

            // Remove the old tree nodes that may be present under this session tree node.
            theEmulatorTreeNode.Nodes.Clear();

            if (!isExecuting)
            {
                foreach (string theResultsFile in theResultsFiles)
                {
                    TreeNode theTreeNode = new TreeNode();
                    theEmulatorTreeNode.Nodes.Add(theTreeNode);

                    UpdateResultsFileNode(theTreeNode, theSession, theResultsFile);
                }
            }
        }
예제 #19
0
 // ctor
 internal CredentialHandling(
     Dvtk.Sessions.ISecure secureSession)
 {
     this._securitySettings = secureSession.SecuritySettings;
     this._password = this._securitySettings.TlsPassword;
     this._fileName = this._securitySettings.CredentialsFileName;
     // Auto load credential file using the session settings.
     this.LoadCredentialFile(this._fileName, this._password);
 }
예제 #20
0
        /// <summary>
        /// Update the emulator session node (update the supplied node and create sub-nodes if necessary).
        /// 
        /// Pre-condition:
        /// - The supplied session is not executing.
        /// - The supplied session is executing in another Session Tree View.
        /// </summary>
        /// <param name="theEmulatorSessionTreeNode">The tree node representing the Emulator Session.</param>
        /// <param name="theSession">The session.</param>
        public void UpdateEmulatorSessionNode(TreeNode theEmulatorSessionTreeNode, Dvtk.Sessions.Session theSession)
        {
            bool isSessionExecuting = _MainForm.IsExecuting(theSession);
            bool isSessionExecutingInOtherSessionTreeView = (isSessionExecuting && (theSession != GetExecutingSession()));

            // Set the tag for this session tree node.
            EmulatorSessionTag theEmulatorSessionTag = new EmulatorSessionTag(theSession);
            theEmulatorSessionTreeNode.Tag = theEmulatorSessionTag;

            // Remove the old tree nodes that may be present under this session tree node.
            theEmulatorSessionTreeNode.Nodes.Clear();

            // If this session is executing...
            if (isSessionExecutingInOtherSessionTreeView)
            {
                // Do nothing.
            }
            else if (!isSessionExecuting)
            {
                ArrayList theResultsFiles; // The result files belonging to this session.

                // Get all result files from this session.
                theResultsFiles = ResultsFile.GetVisibleNamesForSession(theSession);

                // Add the Storage SCP emulator tree node.
                TreeNode theStorageScpEmulatorTreeNode = new TreeNode();
                theEmulatorSessionTreeNode.Nodes.Add(theStorageScpEmulatorTreeNode);

                string theStorageScpBaseName = ResultsFile.GetBaseNameForEmulator(EmulatorTag.EmulatorType.STORAGE_SCP);
                ArrayList theStorageScpEmulatorResultsFiles = ResultsFile.GetNamesForBaseName(theStorageScpBaseName, theResultsFiles);
                theResultsFiles = ResultsFile.FilterOutResultsFileNames(theResultsFiles, theStorageScpEmulatorResultsFiles);

                UpdateEmulatorNode(theStorageScpEmulatorTreeNode, theSession, theStorageScpEmulatorResultsFiles, EmulatorTag.EmulatorType.STORAGE_SCP, false);

                // Add the Storage SCU emulator tree node.
                TreeNode theStorageScuEmulatorTreeNode = new TreeNode();
                theEmulatorSessionTreeNode.Nodes.Add(theStorageScuEmulatorTreeNode);

                string theStorageScuBaseName = ResultsFile.GetBaseNameForEmulator(EmulatorTag.EmulatorType.STORAGE_SCU);
                ArrayList theStorageScuEmulatorResultsFiles = ResultsFile.GetNamesForBaseName(theStorageScuBaseName, theResultsFiles);
                theResultsFiles = ResultsFile.FilterOutResultsFileNames(theResultsFiles, theStorageScuEmulatorResultsFiles);

                UpdateEmulatorNode(theStorageScuEmulatorTreeNode, theSession, theStorageScuEmulatorResultsFiles, EmulatorTag.EmulatorType.STORAGE_SCU, false);

                // Add the Print SCP emulator tree node.
                TreeNode thePrintScpEmulatorTreeNode = new TreeNode();
                theEmulatorSessionTreeNode.Nodes.Add(thePrintScpEmulatorTreeNode);

                string thePrintScpBaseName = ResultsFile.GetBaseNameForEmulator(EmulatorTag.EmulatorType.PRINT_SCP);
                ArrayList thePrintScpEmulatorResultsFiles = ResultsFile.GetNamesForBaseName(thePrintScpBaseName, theResultsFiles);
                theResultsFiles = ResultsFile.FilterOutResultsFileNames(theResultsFiles, thePrintScpEmulatorResultsFiles);

                UpdateEmulatorNode(thePrintScpEmulatorTreeNode, theSession, thePrintScpEmulatorResultsFiles, EmulatorTag.EmulatorType.PRINT_SCP, false);
            }
            else
            {
                // Sanity check, pre-condition of this method is not fullfilled.
                Debug.Assert(false);
            }
        }
예제 #21
0
파일: Form.cs 프로젝트: ewcasas/DVTK
 public void Attach(Dvtk.IheActors.IheFramework.IheFramework iheFramework)
 {
     iheFramework.Attach(this);
 }
예제 #22
0
        public void UpdateMediaSessionNode(TreeNode theMediaSessionTreeNode, Dvtk.Sessions.Session theSession)
        {
            bool isSessionExecuting = _MainForm.IsExecuting(theSession);

            // Set the tag for this session tree node.
            MediaSessionTag theMediaSessionTag = new MediaSessionTag(theSession);
            theMediaSessionTreeNode.Tag = theMediaSessionTag;

            // Remove the old tree nodes that may be present under this session tree node.
            theMediaSessionTreeNode.Nodes.Clear();

            if (!isSessionExecuting)
            {
                ArrayList theResultsFileNames = ResultsFile.GetVisibleNamesForSession(theSession);
                ArrayList theResultsFileBaseNames = ResultsFile.GetBaseNamesForResultsFiles(theResultsFileNames);

                foreach(string theBaseName in theResultsFileBaseNames)
                {
                    string theNodeText = "";
                    ArrayList theResultsFileNamesForBaseName = ResultsFile.GetNamesForBaseName(theBaseName, theResultsFileNames);
                    theResultsFileNames = ResultsFile.FilterOutResultsFileNames(theResultsFileNames, theResultsFileNamesForBaseName);

                    TreeNode theTreeNode = new TreeNode();
                    theMediaSessionTreeNode.Nodes.Add(theTreeNode);

                    if (theBaseName.ToLower().EndsWith("_DCM"))
                    {
                        theNodeText = theBaseName.Substring(0, theBaseName.Length - 4);
                    }
                    else
                    {
                        theNodeText = theBaseName;
                    }

                    UpdateResultsCollectionNode(theTreeNode, theNodeText, theSession, theResultsFileNamesForBaseName);
                }
            }
        }
예제 #23
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="id">Actor Id.</param>
 /// <param name="iheFramework">Ihe Framework container.</param>
 public PrintComposerActor(System.String id, Dvtk.IheActors.IheFramework.IheFramework iheFramework)
     : base(new ActorName(ActorTypeEnum.PrintComposer, id), iheFramework)
 {
 }
예제 #24
0
파일: Session.cs 프로젝트: ewcasas/DVTK
 /// <summary>
 /// Conversion Dvtk type => Wrappers type
 /// </summary>
 /// <param name="value">in</param>
 /// <returns>out</returns>
 private static Wrappers.StorageMode _Convert(Dvtk.Sessions.StorageMode value)
 {
     switch (value)
     {
         case Dvtk.Sessions.StorageMode.AsDataSet:
             return Wrappers.StorageMode.StorageModeAsDataSet;
         case Dvtk.Sessions.StorageMode.AsMedia:
             return Wrappers.StorageMode.StorageModeAsMedia;
         case Dvtk.Sessions.StorageMode.NoStorage:
             return Wrappers.StorageMode.StorageModeNoStorage;
         case Dvtk.Sessions.StorageMode.TemporaryPixelOnly:
             return Wrappers.StorageMode.StorageModeTemporaryPixelOnly;
         default:
             // Unknown Dvtk.Sessions.StorageMode
             throw new System.NotImplementedException();
     }
 }
예제 #25
0
파일: DICOMEditor.cs 프로젝트: ewcasas/DVTK
		/// <summary>
		/// Activity logging handler
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="theArgs"></param>
		private void OnActivityReportEvent(object sender, Dvtk.Events.ActivityReportEventArgs e)
		{
			string message;
			switch(e.ReportLevel)
			{
				case Dvtk.Events.ReportLevel.Error:
					message = "Error:" + e.Message + '\n';
					break;

				case Dvtk.Events.ReportLevel.Warning:
					message = "Warning:" + e.Message + '\n';
					break;

				default:
					message = e.Message + '\n';
					break;
			}

			if (richTextBoxLog.InvokeRequired) 
			{
				richTextBoxLog.Invoke(activityLoggingDelegate, new object[] {message});
			}
			else 
			{
				richTextBoxLog.AppendText(e.Message + '\n');
			}		
		}
예제 #26
0
        /// <summary>
        /// Set the Comparators needed to handle each message in the Transaction.
        /// </summary>
        /// <param name="comparatorCollection">Comparator collection to fill.</param>
        public void SetComparators(Dvtk.Comparator.BaseComparatorCollection comparatorCollection)
        {
            if (_transaction is DicomTransaction)
            {
                System.String name = System.String.Empty;

                DicomTransaction dicomTransaction = (DicomTransaction)_transaction;
                switch(dicomTransaction.Direction)
                {
                    case TransactionDirectionEnum.TransactionReceived:
                        name = System.String.Format("Received by {0}:{1} from {2}:{3}",
                            ActorTypes.Type(_toActorName.Type),
                            _toActorName.Id,
                            ActorTypes.Type(_fromActorName.Type),
                            _fromActorName.Id);
                        break;
                    case TransactionDirectionEnum.TransactionSent:
                        name = System.String.Format("Sent from {0}:{1} to {2}:{3}",
                            ActorTypes.Type(_toActorName.Type),
                            _toActorName.Id,
                            ActorTypes.Type(_fromActorName.Type),
                            _fromActorName.Id);
                        break;
                    default:
                        break;
                }

                for (int i = 0; i < dicomTransaction.DicomMessages.Count; i++)
                {
                    DicomMessage dicomMessage = (DicomMessage)dicomTransaction.DicomMessages[i];

                    DvtkHighLevelInterface.Comparator.Comparator comparator = new DvtkHighLevelInterface.Comparator.Comparator(name);
                    Dvtk.Comparator.DicomComparator dicomComparator = comparator.InitializeDicomComparator(dicomMessage);
                    if (dicomComparator != null)
                    {
                        comparatorCollection.Add(dicomComparator);
                    }
                }
            }
            else if (_transaction is Hl7Transaction)
            {
                System.String name = System.String.Empty;

                Hl7Transaction hl7Transaction = (Hl7Transaction)_transaction;
                switch(hl7Transaction.Direction)
                {
                    case TransactionDirectionEnum.TransactionReceived:
                        name = System.String.Format("Received by {0}:{1} from {2}:{3}",
                            ActorTypes.Type(_toActorName.Type),
                            _toActorName.Id,
                            ActorTypes.Type(_fromActorName.Type),
                            _fromActorName.Id);
                        break;
                    case TransactionDirectionEnum.TransactionSent:
                        name = System.String.Format("Sent from {0}:{1} to {2}:{3}",
                            ActorTypes.Type(_toActorName.Type),
                            _toActorName.Id,
                            ActorTypes.Type(_fromActorName.Type),
                            _fromActorName.Id);
                        break;
                    default:
                        break;
                }

                Hl7Message hl7Message= hl7Transaction.Request;

                DvtkHighLevelInterface.Comparator.Comparator comparator = new DvtkHighLevelInterface.Comparator.Comparator(name);
                Dvtk.Comparator.Hl7Comparator hl7Comparator = comparator.InitializeHl7Comparator(hl7Message);
                if (hl7Comparator != null)
                {
                    comparatorCollection.Add(hl7Comparator);
                }
            }
        }
예제 #27
0
파일: Session.cs 프로젝트: ewcasas/DVTK
 /// <summary>
 /// Occurs when a activity report is generated by the application.
 /// </summary>
 /// <remarks>
 /// Users may register a callback to listen for this event.
 /// </remarks>
 protected static void ActivityReportEventHandler(object sender, Dvtk.Events.ActivityReportEventArgs e)
 {
     // format -15 equals left-alignment with a preferred width of 15 characters.
     System.Console.WriteLine(
         string.Format("{0,-15}: {1}", e.ReportLevel, e.Message));
 }
예제 #28
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="id">Actor Id.</param>
 /// <param name="iheFramework">Ihe Framework container.</param>
 public ImageDisplayActor(System.String id, Dvtk.IheActors.IheFramework.IheFramework iheFramework)
     : base(new ActorName(ActorTypeEnum.ImageDisplay, id), iheFramework)
 {
 }
예제 #29
0
 public void SetSessionChanged(Dvtk.Sessions.Session theSession)
 {
     if (theSession == _SessionUsedForContentsOfTabSpecifySopClasses)
     {
         _SessionUsedForContentsOfTabSpecifySopClasses = null;
     }
 }
예제 #30
0
        public void SetComparators(Dvtk.Comparator.BaseComparatorCollection comparatorCollection)
        {
            if (_transaction is DicomTransaction)
            {
                System.String name = System.String.Empty;

                DicomTransaction dicomTransaction = (DicomTransaction)_transaction;
                switch(dicomTransaction.Direction)
                {
                    case TransactionDirectionEnum.TransactionReceived:
                        name = System.String.Format("Received by {0} from {1}", ActorNames.Name(_fromActorName), ActorNames.Name(_toActorName));
                        break;
                    case TransactionDirectionEnum.TransactionSent:
                        name = System.String.Format("Sent from {0} to {1}", ActorNames.Name(_fromActorName), ActorNames.Name(_toActorName));
                        break;
                    default:
                        break;
                }

                for (int i = 0; i < dicomTransaction.DicomMessages.Count; i++)
                {
                    DicomMessage dicomMessage = (DicomMessage)dicomTransaction.DicomMessages[i];

                    DvtkHighLevelInterface.Comparator.Comparator comparator = new DvtkHighLevelInterface.Comparator.Comparator(name);
                    Dvtk.Comparator.DicomComparator dicomComparator = comparator.InitializeDicomComparator(dicomMessage);
                    if (dicomComparator != null)
                    {
                        comparatorCollection.Add(dicomComparator);
                    }
                }
            }
        }