/// <summary>
        /// The run.
        /// </summary>
        /// <param name="timeoutInMilliseconds">
        /// The timeout in milliseconds.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool Run(int timeoutInMilliseconds)
        {
            // instanciate module
            var function         = new Functions.ApplicationArea.Page_Home.Page_Home_Functions();
            var processFunctions = new Functions.Helpers.DeviceCareProcessFunctions();

            // close frame
            function.CloseFrame();

            // check if frame is closed
            // NOTE: IsFrameClosed(int timeOutInMilliseconds) always needs a timeout parameter. If user timeout shall be omitted, set timeout to 0 or -1 (default 30s is used then)
            if (function.IsFrameClosed(timeoutInMilliseconds))
            {
                // for debugging:
                // simulates that the process is still running in background
                // user has to open devicecare again in that time window
                // Delay.Milliseconds(10000);
                // check if process is terminated
                if (function.IsDCProcessTerminated())
                {
                    Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Closing Host Application was successful");
                    return(true);
                }

                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The DeviceCare process is still running");
                CommonInternal.ProcessInformation.PublishProcessSummary(processFunctions.GetDcProcess());
                return(false);
            }

            Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Frame was not successfully closed");
            return(false);
        }
Example #2
0
        /// <summary>
        /// The run.
        /// </summary>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool Run()
        {
            var scan = new Functions.ApplicationArea.Page_Home.Page_Home_Functions();

            Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Current task: Create online topology");

            return(scan.PerformAutomaticScan());
        }
Example #3
0
        /// <summary>
        /// The run.
        /// </summary>
        /// <param name="communications">
        /// The communications.
        /// </param>
        /// <param name="devices">
        /// The devices.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool Run(List <string> communications, List <string> devices)
        {
            // instanciate all necessary modules
            var connect                 = new Functions.Helpers.InterfaceHelpers.OnlineConnectFunctions();
            var protocolPage            = new Functions.ApplicationArea.Page_Assistant_ProtocolSelection.Assistant_ProtocolSelection_Function();
            var homeFunctions           = new Functions.ApplicationArea.Page_Home.Page_Home_Functions();
            var modemSelectionFunctions = new Functions.ApplicationArea.Page_Assistant_ModemSelection.Assistant_ModemSelection_Functions();
            var commDtmFunctions        = new Functions.ApplicationArea.Page_Assistant_ConfigureCommDTM.Assistant_ConfigureCommDTM_Functions();
            var statusbarFunctions      = new Functions.StatusArea.Statusbar.Statusbar_Functions();

            var repo = GUI.DeviceCareApplication.Instance;

            homeFunctions.ClickAssistant();

            // click button assistant
            if (connect.WaitForItemVisible(repo.DeviceCare.ApplicationArea.Page_Assistant.ProtocolSelectionPage.Text_Title_ProtocolInfo))
            {
                // click protocol button
                protocolPage.SelectProtocol(communications[0]);

                if (connect.WaitForItemVisible(repo.DeviceCare.ApplicationArea.Page_Assistant.ModemSelectionPages.Text_Title_ModemInfo))
                {
                    // click modem button
                    modemSelectionFunctions.SelectModem(communications[0], communications[2]);

                    if (connect.WaitForItemVisible(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SelfInfo))
                    {
                        // dtm configuration page
                        commDtmFunctions.OpenAdvancedConfiguration();

                        if (connect.WaitForItemVisible(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.CommDTMHostingGUIInfo))
                        {
                            // configure Comm DTM -> CommLayer function

                            // TODO: CommLayer has to be implemented

                            // scan button
                            commDtmFunctions.ClickScan();

                            if (statusbarFunctions.WaitForScanning(communications[1]))
                            {
                                Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Scanning process was started successfully");
                                return(true);
                            }
                        }
                    }
                }
            }

            return(false);
        }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public bool Run()
        {
            Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Current task: Register Device Type");
            Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Host Application: DeviceCare does not implicitly support registering a device type \r\nA DTM catalog update will be triggered");

            var functions_pageSettings = new Functions.ApplicationArea.Page_Settings.Page_Settings_Functions();
            var functions_pageHome     = new Functions.ApplicationArea.Page_Home.Page_Home_Functions();

            //precondition: home screen is shown
            if (!functions_pageHome.IsHomePageShown())
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Home screen is not shown. Cannot start execution of the task");
                return(false);
            }

            //open settings menu
            functions_pageSettings.OpenSettingsPage();

            if (functions_pageSettings.IsSettingsPageShown())
            {
                //open dtm catalog page
                functions_pageSettings.OpenDTMCatalog();

                if (functions_pageSettings.IsDTMCatalogShown())
                {
                    //press f5 for catalog update
                    Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "DTM catalog update will be triggered...");
                    return(functions_pageSettings.TriggerUpdate());
                }
                else
                {
                    Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "DTM catalog is not shown. Terminating execution");
                    return(false);
                }
            }
            else
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Settings page is not shown. Terminating execution");
                return(false);
            }
        }