Ejemplo n.º 1
0
        /// <summary>
        /// Remove all expanded information for the supplied session.
        /// </summary>
        /// <param name="theSession">The session.</param>
        public void RemoveExpandInformationForSession(DvtkApplicationLayer.Session theSession)
        {
            ArrayList theTagsToRemove = new ArrayList();

            foreach(Object theTreeNodeTag in _TagsOfExpandedNodes)
            {
                DvtkApplicationLayer.Session tempSession = null;
                if (theTreeNodeTag is PartOfSession) {
                    DvtkApplicationLayer.PartOfSession partOfSession = theTreeNodeTag as PartOfSession;
                    tempSession = partOfSession.ParentSession;
                }
                else {
                    tempSession = (DvtkApplicationLayer.Session)theTreeNodeTag;
                }
                if (tempSession == theSession)
                {
                    theTagsToRemove.Add(theTreeNodeTag);
                }
            }

            foreach( Object theTreeNodeTagToRemove in theTagsToRemove)
            {
                _TagsOfExpandedNodes.Remove(theTreeNodeTagToRemove);
            }
        }
Ejemplo n.º 2
0
        public PrintEmulatorStatusForm(DvtkApplicationLayer.EmulatorSession emulator_session)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.session = emulator_session;

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

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

            string statusInfo = this.session.EmulatorSessionImplementation.Printer.StatusInfo.ToString();
            foreach (string info_dt in this.session.EmulatorSessionImplementation.Printer.StatusInfoDefinedTerms)
            {
                this.ComboBoxPrinterStatusInfo.Items.Add (info_dt);
            }

            foreach (object o in this.ComboBoxPrinterStatusInfo.Items)
            {
                if (o.ToString() == statusInfo)
                {
                    this.ComboBoxPrinterStatusInfo.SelectedItem = o;
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        public PassWordForm(DvtkApplicationLayer.Session session, bool pwdCalledFirst)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            this.PasswordTextBox.Text = "";
            this._session = session;

            if (pwdCalledFirst == true)
            {
                this.InvalidPasswordLabel.Text = "Password";
            }
            else
            {
                this.InvalidPasswordLabel.Text = "Invalid Password ";
            }
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Method to backUp the Arraylist of files in a session.
 /// </summary>
 /// <param name="theSession">represents the Session.</param>
 /// <param name="theFilesToBackup"></param>
 public static void BackupFiles(DvtkApplicationLayer.Session theSession, ArrayList theFilesToBackup)
 {
     foreach (string theFileToBackup in theFilesToBackup)
     {
         BackupFile(theSession, theFileToBackup);
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="theSession"></param>
        /// <returns></returns>
        public static ArrayList GetAllNamesForSession(DvtkApplicationLayer.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;
        }
Ejemplo n.º 6
0
 public void SetSessionChanged(DvtkApplicationLayer.Session theSession)
 {
     if (theSession == _SessionUsedForContentsOfTabSpecifySopClasses)
     {
         _SessionUsedForContentsOfTabSpecifySopClasses = null;
     }
 }
Ejemplo n.º 7
0
 private DvtkSession.PrinterStatus Convert(DvtkApplicationLayer.EmulatorSession.PrinterStatus value)
 {
     switch (value) {
         case PrinterStatus.NORMAL:
             return DvtkSession.PrinterStatus.NORMAL;
         case PrinterStatus.WARNING:
             return DvtkSession.PrinterStatus.WARNING;
         case PrinterStatus.FAILURE:
             return DvtkSession.PrinterStatus.FAILURE;
         default:
             throw new System.NotSupportedException();
     }
 }
Ejemplo n.º 8
0
        private static void BackupFile(DvtkApplicationLayer.Session theSession, string theFileToBackup)
        {
            string theSourceFullFileName = System.IO.Path.Combine(theSession.ResultsRootDirectory, theFileToBackup);
            string theDestinyFullFileName = theSourceFullFileName + "_backup";
            int theCounter = 1;

            try
            {
                while (File.Exists(theDestinyFullFileName + theCounter.ToString()))
                {
                    theCounter++;
                }

                File.Copy(theSourceFullFileName, theDestinyFullFileName + theCounter.ToString());
            }
            catch
            {
                // Don't do anything in the release version.
                Debug.Assert(false);
            }
        }
Ejemplo n.º 9
0
 public DialogResult ShowDialog(IWin32Window theIWin32Window, DvtkApplicationLayer.EmulatorSession theEmulatorSession)
 {
     _EmulatorSession = theEmulatorSession;
     return(ShowDialog(theIWin32Window));
 }
Ejemplo n.º 10
0
        /// <summary>
        /// From a list of results file names, return those results file names with the same session ID
        /// as the session ID of the supplied session.
        /// </summary>
        /// <param name="theSession">The session.</param>
        /// <param name="theResultsFileNames">Valid results file names.</param>
        /// <returns>List of results file names.</returns>
        public static ArrayList GetNamesForCurrentSessionId(DvtkApplicationLayer.Session  theSession, ArrayList theResultsFileNames)
        {
            ArrayList theNamesForCurrentSession = new ArrayList();
            string theSessionIdAsString = theSession.SessionId.ToString("000");

            foreach(string theResultsFileName in theResultsFileNames) {
                string theResultsFileSessionIdAsString = "";

                if (theResultsFileName.ToLower().StartsWith(_SUMMARY_PREFIX)) {
                    theResultsFileSessionIdAsString = theResultsFileName.Substring(_SUMMARY_PREFIX.Length, 3);
                }
                else if (theResultsFileName.ToLower().StartsWith(_DETAIL_PREFIX)) {
                    theResultsFileSessionIdAsString = theResultsFileName.Substring(_DETAIL_PREFIX.Length, 3);
                }
                else
                {
                    // Sanity check.
                    Debug.Assert(false);
                }

                if (theResultsFileSessionIdAsString == theSessionIdAsString)
                {
                    theNamesForCurrentSession.Add(theResultsFileName);
                }
            }

            return(theNamesForCurrentSession);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="theSession"></param>
 /// <param name="theScriptFileName"></param>
 /// <returns></returns>
 public static string GetSummaryNameForScriptFile(DvtkApplicationLayer.Session theSession, string theScriptFileName)
 {
     return("Summary_" + GetExpandedNameForScriptFile(theSession, theScriptFileName));
 }
Ejemplo n.º 12
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="theProject"></param>
        /// <param name="theMainForm"></param>
        public ProjectForm2(DvtkApplicationLayer.Project theProject, MainForm theMainForm)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.userControlSessionTree.projectApp = theProject;
            userControlSessionTree.ProjectForm = this;
            _ActivityReportEventHandler = new Dvtk.Events.ActivityReportEventHandler(TCM_OnActivityReportEvent);
            projectApp = theProject;
            _MainForm = theMainForm;
            ListBoxSecuritySettings.SelectedIndex = 0;
            _SopClassesManager = new SopClassesManager(this, DataGridSpecifySopClasses, ComboBoxSpecifySopClassesAeTitle, ListBoxSpecifySopClassesDefinitionFileDirectories, RichTextBoxSpecifySopClassesInfo, userControlSessionTree, ButtonSpecifySopClassesRemoveDirectory);
            _TCM_ValidationResultsBrowser = new ValidationResultsManager(webBrowserValResult);
            //_TCM_ValidationResultsManagerBrowser = new ValidationResultsManager(webBrowserResultMgr);

            // Because the webbrowser navigation is "cancelled" when browsing to an .xml file
            // first another html file has to be shown to make this work under Windows 2000.
            _TCM_ValidationResultsBrowser.ShowHtml("about:blank");
            _TCM_AppendTextToActivityLogging_ThreadSafe_Delegate = new TCM_AppendTextToActivityLogging_ThreadSafe_Delegate(this.TCM_AppendTextToActivityLogging_ThreadSafe);

            resultProjectXml  = projectApp.ProjectFileName + ".xml";
        }
Ejemplo n.º 13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="theSession"></param>
 /// <param name="theEmulatorType"></param>
 /// <returns></returns>
 public static string GetExpandedNameForEmulator(DvtkApplicationLayer.Session theSession, Emulator.EmulatorTypes theEmulatorType)
 {
     return(GetExpandedName(theSession, GetBaseNameForEmulator(theEmulatorType)));
 }
Ejemplo n.º 14
0
        public void UpdateScriptFileNode(TreeNode scriptFileTreeNode,DvtkApplicationLayer.Script scriptFile )
        {
            // Set the text on this script file tree node.

            if (scriptFile.ParentSession.IsExecute) {
                scriptFileTreeNode.Text = scriptFile.ScriptFileName + " (executing)";
            }
            else {
                scriptFileTreeNode.Text = scriptFile.ScriptFileName;
            }

            // Set the tag for this script file tree node.
            scriptFileTreeNode.Tag = scriptFile;

            // Remove the old tree nodes that may be present under this script file tree node.
            scriptFileTreeNode.Nodes.Clear();

            // For all results that belong to this script file, create a sub node.
            // The theResultsFiles object contains all results files that have not yet been added to
            // already processed script file nodes.

            foreach (Result results in scriptFile.Result ) {
                foreach (string filename in results.ResultFiles) {
                    TreeNode resultsFileTreeNode = new TreeNode();
                    scriptFileTreeNode.Nodes.Add(resultsFileTreeNode);
                    UpdateResultsFileNode(resultsFileTreeNode,results ,filename );
                }
            }
        }
Ejemplo n.º 15
0
 public void UpdateMediaSessionNode(TreeNode mediaSessionTreeNode, DvtkApplicationLayer.MediaSession mediaSession)
 {
     bool isSessionExecuting = mediaSession.IsExecute;
     // Set the tag for this session tree node.
     mediaSessionTreeNode.Tag = mediaSession;
     // Remove the old tree nodes that may be present under this session tree node.
     mediaSessionTreeNode.Nodes.Clear();
     mediaSession.CreateMediaFiles();
     if (!isSessionExecuting) {
         if (mediaSession.MediaFiles == null ){
         }
         else {
             foreach(MediaFile mediaFile in mediaSession.MediaFiles) {
                 TreeNode mediaTreeNode = new TreeNode();
                 mediaSessionTreeNode.Nodes.Add(mediaTreeNode);
                 UpdateMediaFileNode(mediaTreeNode , mediaFile);
             }
         }
     }
 }
Ejemplo n.º 16
0
        public void UpdateMediaFileNode(TreeNode mediaFileTreeNode,DvtkApplicationLayer.MediaFile mediaFile )
        {
            mediaFileTreeNode.Text = mediaFile.MediaFileName ;
            // Set the tag for this media file tree node.
            mediaFileTreeNode.Tag = mediaFile;

            // Remove the old tree nodes that may be present under this script file tree node.
            mediaFileTreeNode.Nodes.Clear();
            // For all results that belong to this media file, create a sub node.
            // The theResultsFiles object contains all results files that have not yet been added to
            // already processed script file nodes.

            foreach (Result results in mediaFile.Result ) {
                foreach (string filename in results.ResultFiles) {
                    TreeNode resultsFileTreeNode = new TreeNode();
                    mediaFileTreeNode.Nodes.Add(resultsFileTreeNode);
                    UpdateResultsFileNode(resultsFileTreeNode,results,filename);
                }
            }
        }
Ejemplo n.º 17
0
        //        public TreeNode GetSessionNode(DvtkApplicationLayer.Session session) {
        //            TreeNode theSessionNodeToFind = null;
        //
        //            foreach (TreeNode theNode in userControlTreeView.Nodes) {
        //                if (theNode.Tag is DvtkApplicationLayer.Session) {
        //                    Object  theSessionTag = (DvtkApplicationLayer.Session)theNode.Tag;
        //
        //                    if (theSessionTag == session) {
        //                        theSessionNodeToFind = theNode;
        //                        break;
        //                    }
        //                }
        //            }
        //
        //            return(theSessionNodeToFind);
        //        }
        public TreeNode GetSessionNode(DvtkApplicationLayer.Session session)
        {
            TreeNode theSessionNodeToFind = null;

            foreach (TreeNode theNode in userControlTreeView.Nodes)
            {
                if (theNode.Tag is DvtkApplicationLayer.Project)
                {
                    foreach (TreeNode node in  theNode.Nodes )
                    {
                        if (node.Tag is DvtkApplicationLayer.Session)
                        {
                            Object  theSessionTag = (DvtkApplicationLayer.Session)node.Tag;

                            if (theSessionTag == session)
                            {
                                theSessionNodeToFind = node;
                                break;
                            }
                        }
                    }
                }
            }

            return(theSessionNodeToFind);
        }
Ejemplo n.º 18
0
        public CredentialsCertificatesForm(DvtkApplicationLayer.Session session, bool show_credentials)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            if (session.Implementation is Dvtk.Sessions.ISecure)
            {
                this._show_credentials = show_credentials;
                this._session = session;
                this.ButtonRemoveCertificate.Enabled = false;

                if (show_credentials)
                {
                    this.Text = "DVT Private Keys (credentials)";
                    this.ButtonChangePassword.Visible = true ;
                    _FileContainingKeys = (session.Implementation as Dvtk.Sessions.ISecure).SecuritySettings.CredentialsFileName;
                    this._cred_handling = (session.Implementation as Dvtk.Sessions.ISecure).CreateSecurityCredentialHandler ();
                }
                else
                {
                    this.Text = "SUT Public Keys (certificates)";
                    this.ButtonChangePassword.Visible = false ;
                    _FileContainingKeys = (session.Implementation as Dvtk.Sessions.ISecure).SecuritySettings.CertificateFileName;
                    this._cert_handling = (session.Implementation as Dvtk.Sessions.ISecure).CreateSecurityCertificateHandler ();
                }
                FileInfo cert_file = new FileInfo (_FileContainingKeys);

                if (cert_file.Exists)
                {
                    try
                    {
                        if (show_credentials)
                        {
                            FileInfo    file;

                            file = new FileInfo (this._cred_handling.FileName);
                            _FileContainingKeys = this._cred_handling.FileName;

                            if (file.Exists)
                            {
                                _ExceptionText = "";
                                _KeysInformation = ConvertToKeyInformationArrayList(_cred_handling.Credentials);
                                DataGridCertificates.DataSource = _KeysInformation;
                                Debug.Assert(_ExceptionText.Length == 0, "Following errors occured while filling datagrid:\n\n" + _ExceptionText);

                            }

                            if (this._cred_handling.Credentials.Count > 0)
                                this.ButtonRemoveCertificate.Enabled = true;
                        }
                        else
                        {
                            FileInfo    file;

                            file = new FileInfo (this._cert_handling.FileName);
                            _FileContainingKeys = this._cert_handling.FileName;

                            if (file.Exists)
                            {
                                _ExceptionText = "";
                                _KeysInformation = ConvertToKeyInformationArrayList(_cert_handling.Certificates);
                                DataGridCertificates.DataSource = _KeysInformation;
                                Debug.Assert(_ExceptionText.Length == 0, "Following errors occured while filling datagrid:\n\n" + _ExceptionText);
                            }
                            if (this._cert_handling.Certificates.Count > 0)
                                this.ButtonRemoveCertificate.Enabled = true;
                        }
                    }
                    catch
                    {
                        this.DataGridCertificates.DataSource = null;
                    }
                }
            }
        }
Ejemplo n.º 19
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="theSession"></param>
 /// <param name="theScriptFileName"></param>
 /// <returns></returns>
 public static string GetExpandedNameForScriptFile(DvtkApplicationLayer.Session theSession, string theScriptFileName)
 {
     return(GetExpandedName(theSession, GetBaseNameForScriptFile(theScriptFileName)));
 }
Ejemplo n.º 20
0
 public SessionChange(DvtkApplicationLayer.Session theSession, SessionChangeSubTypEnum theSessionChangeSubTyp)
 {
     session = theSession;
     _SessionChangeSubTyp = theSessionChangeSubTyp;
 }
Ejemplo n.º 21
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="theSession"></param>
 /// <param name="theEmulatorType"></param>
 /// <returns></returns>
 public static string GetSummaryNameForEmulator(DvtkApplicationLayer.Session theSession, Emulator.EmulatorTypes theEmulatorType)
 {
     return("Summary_" + GetExpandedNameForEmulator(theSession, theEmulatorType));
 }
Ejemplo n.º 22
0
 public SessionRemovedEvent(DvtkApplicationLayer.Session theSession)
 {
     _Session = theSession;
 }
Ejemplo n.º 23
0
        /// <summary>
        /// Remove .xml files, and if exisiting, the corresponding .html files.
        /// </summary>
        /// <param name="theSession">The session.</param>
        /// <param name="theResultsFileNames">The results file names.</param>
        public static void Remove(DvtkApplicationLayer.Session theSession, ArrayList theResultsFileNames)
        {
            foreach(string theResultsFileName in theResultsFileNames) {
                string theXmlResultsFullFileName = System.IO.Path.Combine(theSession.ResultsRootDirectory, theResultsFileName);
                string theHtmlResultsFullFileName = theXmlResultsFullFileName.ToLower().Replace(".xml", ".html");

                if (!File.Exists(theXmlResultsFullFileName))
                {
                    // Sanity check.
                    Debug.Assert(false);
                }
                else
                {
                    try
                    {
                        File.Delete(theXmlResultsFullFileName);
                    }
                    catch(Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                        // In release mode, just continue.
                        Debug.Assert(false);
                    }
                }

                if (File.Exists(theHtmlResultsFullFileName))
                {
                    try
                    {
                        File.Delete(theHtmlResultsFullFileName);
                    }
                    catch(Exception ex)
                    {
                        // In release mode, just continue.
                        MessageBox.Show(ex.Message);
                        Debug.Assert(false);
                    }
                }
            }
        }
Ejemplo n.º 24
0
 public SessionReplaced(DvtkApplicationLayer.Session theOldSession, DvtkApplicationLayer.Session theNewSession)
 {
     _OldSession = theOldSession;
     _NewSession = theNewSession;
 }
Ejemplo n.º 25
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="theSession"></param>
 /// <param name="theString"></param>
 /// <returns></returns>
 private static string GetExpandedName(DvtkApplicationLayer.Session theSession, string theString)
 {
     return(theSession.SessionId.ToString("000") + '_' + theString + "_res.xml");
 }
Ejemplo n.º 26
0
        public void ConstructAndSaveProject(DvtkApplicationLayer.Project theProject)
        {
            theProject.display_message = new DvtkApplicationLayer.Project.CallBackMessageDisplay (this.CallBackMessageDisplay);

            theProject.New(this.ProjectFileName.Text);

            foreach (object session in this.ListBoxSessions.Items)
            {
                theProject.AddSession(session.ToString());
            }

            theProject.SaveProject();
        }