Ejemplo n.º 1
0
        public void SetSelectedAeTitleVersion()
        {
            Dvtk.Sessions.Session theSession = GetSessionTreeViewManager().GetSelectedSession();

            AeTitleVersion theCurrentAeTitleVersionInComboBox = null;

            foreach (AeTitleVersion theAeTitleVersion in _ComboBoxAeTitle.Items)
            {
                if ((theAeTitleVersion._AeTitle == theSession.DefinitionManagement.ApplicationEntityName) &&
                    (theAeTitleVersion._Version == theSession.DefinitionManagement.ApplicationEntityVersion))
                {
                    theCurrentAeTitleVersionInComboBox = theAeTitleVersion;
                    break;
                }
            }

            if (theCurrentAeTitleVersionInComboBox != null)
            {
                _ComboBoxAeTitle.SelectedItem = theCurrentAeTitleVersionInComboBox;
            }
            else
            {
                _ComboBoxAeTitle.SelectedItem = _DefaultAeTitleVersion;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="theDataGridSopClasses">The DataGrid that is managed by this class.</param>
        /// <param name="theSessionTreeViewManager">The associated session tree view manager.</param>
        public SopClassesManager(ProjectForm2 theProjectForm2, System.Windows.Forms.DataGrid theDataGridSopClasses, System.Windows.Forms.ComboBox theComboBoxAeTitle, System.Windows.Forms.ListBox theListBoxDefinitionFileDirectories, System.Windows.Forms.RichTextBox theRichTextBoxInfo, UserControlSessionTree theUserControlSessionTree, System.Windows.Forms.Button theButtonRemoveDirectory)
        {
            _ProjectForm2       = theProjectForm2;
            _DataGridSopClasses = theDataGridSopClasses;
            _ComboBoxAeTitle    = theComboBoxAeTitle;
            _ListBoxDefinitionFileDirectories = theListBoxDefinitionFileDirectories;
            _RichTextBoxInfo                = theRichTextBoxInfo;
            _ButtonRemoveDirectory          = theButtonRemoveDirectory;
            _UserControlSessionTree         = theUserControlSessionTree;
            _theDefinitionFileTextColumn    = new DataGridTextBoxColumn();
            _DefinitionFilesInfoForDataGrid = new ArrayList();
            _DefaultAeTitleVersion          = new AeTitleVersion("DICOM", "3.0");

            Initialize();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="theDataGridSopClasses">The DataGrid that is managed by this class.</param>
        /// <param name="theSessionTreeViewManager">The associated session tree view manager.</param>
        public SopClassesManager(ProjectForm2 theProjectForm2, System.Windows.Forms.DataGrid theDataGridSopClasses, System.Windows.Forms.ComboBox theComboBoxAeTitle, System.Windows.Forms.ListBox theListBoxDefinitionFileDirectories, System.Windows.Forms.RichTextBox theRichTextBoxInfo, SessionTreeViewManager theSessionTreeViewManager, System.Windows.Forms.Button theButtonRemoveDirectory)
        {
            _ProjectForm2 = theProjectForm2;
            _DataGridSopClasses = theDataGridSopClasses;
            _ComboBoxAeTitle = theComboBoxAeTitle;
            _ListBoxDefinitionFileDirectories = theListBoxDefinitionFileDirectories;
            _RichTextBoxInfo = theRichTextBoxInfo;
            _SessionTreeViewManager = theSessionTreeViewManager;
            _ButtonRemoveDirectory = theButtonRemoveDirectory;

            _DefinitionFilesInfoForDataGrid = new ArrayList();
            _DefaultAeTitleVersion = new AeTitleVersion("DICOM", "3.0");
            _theDefinitionFileTextColumn = new DataGridTextBoxColumn();

            Initialize();
        }
Ejemplo n.º 4
0
        public void SelectedAeTitleVersionChanged()
        {
            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();

            AeTitleVersion theAeTitleVersion = (AeTitleVersion)_ComboBoxAeTitle.SelectedItem;

            if ((theAeTitleVersion._AeTitle != theSession.Implementation.DefinitionManagement.ApplicationEntityName) ||
                (theAeTitleVersion._Version != theSession.Implementation.DefinitionManagement.ApplicationEntityVersion))
            {
                theSession.Implementation.DefinitionManagement.ApplicationEntityName    = theAeTitleVersion._AeTitle;
                theSession.Implementation.DefinitionManagement.ApplicationEntityVersion = theAeTitleVersion._Version;
                // TO DO
                SessionChange theSessionChange = new SessionChange(theSession, SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_AE_TITLE_VERSION);
                Notify(theSessionChange);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// The information from a definition file is added to the datagrid and possibly to the combo box.
        ///
        /// An excpetion is thrown when retrieving details for the definition file fails.
        /// </summary>
        /// <param name="theDefinitionFullFileName">the full file name of the definition file.</param>
        private void AddSopClassToDataGridFromDefinitionFile(string theDefinitionFullFileName)
        {
            DvtkApplicationLayer.Session        theSession = GetSessionTreeViewManager().GetSession();
            Dvtk.Sessions.DefinitionFileDetails theDefinitionFileDetails;

            // Try to get detailed information about this definition file.
            theDefinitionFileDetails = theSession.Implementation.DefinitionManagement.GetDefinitionFileDetails(theDefinitionFullFileName);

            // No excpetion thrown when calling GetDefinitionFileDetails (otherwise this statement would not have been reached)
            // so this is a valid definition file. Add it to the data frid.
            DefinitionFile theDataGridDefinitionFileInfo =
                new DefinitionFile(IsDefinitionFileLoaded(theDefinitionFullFileName),
                                   System.IO.Path.GetFileName(theDefinitionFullFileName),
                                   theDefinitionFileDetails.SOPClassName,
                                   theDefinitionFileDetails.SOPClassUID,
                                   theDefinitionFileDetails.ApplicationEntityName,
                                   theDefinitionFileDetails.ApplicationEntityVersion,
                                   System.IO.Path.GetDirectoryName(theDefinitionFullFileName));

            if (!theDefinitionFullFileName.Contains("AllDimseCommands.def"))
            {
                _DefinitionFilesInfoForDataGrid.Add(theDataGridDefinitionFileInfo);
            }

            // If the AE title - version does not yet exist in the combo box, add it.
            bool IsAeTitleVersionAlreadyInComboBox = false;

            foreach (AeTitleVersion theAeTitleVersion in _ComboBoxAeTitle.Items)
            {
                if ((theAeTitleVersion._AeTitle == theDefinitionFileDetails.ApplicationEntityName) &&
                    (theAeTitleVersion._Version == theDefinitionFileDetails.ApplicationEntityVersion))
                {
                    IsAeTitleVersionAlreadyInComboBox = true;
                    break;
                }
            }

            if (!IsAeTitleVersionAlreadyInComboBox)
            {
                AeTitleVersion theAeTitleVersion = new AeTitleVersion(theDefinitionFileDetails.ApplicationEntityName, theDefinitionFileDetails.ApplicationEntityVersion);
                _ComboBoxAeTitle.Items.Add(theAeTitleVersion);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// The information from a definition file is added to the datagrid and possibly to the combo box.
        /// 
        /// An excpetion is thrown when retrieving details for the definition file fails.
        /// </summary>
        /// <param name="theDefinitionFullFileName">the full file name of the definition file.</param>
        private void AddSopClassToDataGridFromDefinitionFile(string theDefinitionFullFileName)
        {
            Dvtk.Sessions.Session theSession = GetSessionTreeViewManager().GetSelectedSession();
            Dvtk.Sessions.DefinitionFileDetails theDefinitionFileDetails;

            // Try to get detailed information about this definition file.
            theDefinitionFileDetails = theSession.DefinitionManagement.GetDefinitionFileDetails(theDefinitionFullFileName);

            // No excpetion thrown when calling GetDefinitionFileDetails (otherwise this statement would not have been reached)
            // so this is a valid definition file. Add it to the data frid.
            DefinitionFile theDataGridDefinitionFileInfo =
                new DefinitionFile(IsDefinitionFileLoaded(theDefinitionFullFileName),
                System.IO.Path.GetFileName(theDefinitionFullFileName),
                theDefinitionFileDetails.SOPClassName,
                theDefinitionFileDetails.SOPClassUID,
                theDefinitionFileDetails.ApplicationEntityName,
                theDefinitionFileDetails.ApplicationEntityVersion,
                System.IO.Path.GetDirectoryName(theDefinitionFullFileName));

            _DefinitionFilesInfoForDataGrid.Add(theDataGridDefinitionFileInfo);

            // If the AE title - version does not yet exist in the combo box, add it.
            bool IsAeTitleVersionAlreadyInComboBox = false;

            foreach (AeTitleVersion theAeTitleVersion in _ComboBoxAeTitle.Items)
            {
                if ( (theAeTitleVersion._AeTitle == theDefinitionFileDetails.ApplicationEntityName) &&
                    (theAeTitleVersion._Version == theDefinitionFileDetails.ApplicationEntityVersion) )
                {
                    IsAeTitleVersionAlreadyInComboBox = true;
                    break;
                }
            }

            if (!IsAeTitleVersionAlreadyInComboBox)
            {
                AeTitleVersion theAeTitleVersion = new AeTitleVersion(theDefinitionFileDetails.ApplicationEntityName, theDefinitionFileDetails.ApplicationEntityVersion);
                _ComboBoxAeTitle.Items.Add(theAeTitleVersion);
            }
        }