예제 #1
0
        /// <summary>
        /// An event handler called when the run is stopping.
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnRunStopping(object sender, PlManagerEventArgs e)
        {
            // If there are pending tool method calls.
            lock (this.toolSync)
            {
                // Cancel all method.
                foreach (ToolMethodState asyncState in this.toolStates)
                {
                    asyncState.Cancel();
                }
            }

            this.Invoke(() =>
                {
                    // Set the controls enabled state.
                    this.buttonStop.Enabled = false;
                    this.buttonPause.Enabled = false;

                    // Show the progress dialog.
                    this.progress.Show(Resources.GlobeClock_48, "Stopping the PlanetLab commands...");
                    // Log.
                    this.controlLog.Add(this.config.Log.Add(
                        LogEventLevel.Verbose,
                        LogEventType.Information,
                        ControlSliceRun.logSource.FormatWith(this.slice.Id),
                        "Stopping the PlanetLab commands."));
                    // Status.
                    this.status.Send(ApplicationStatus.StatusType.Busy, "Stopping the PlanetLab commands...", Resources.GlobeClock_16);
                });
        }
예제 #2
0
        /// <summary>
        /// An event handler called when the run is starting.
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnRunStarting(object sender, PlManagerEventArgs e)
        {
            // Switch the tab control to the progress tab.
            this.tabControl.SelectedTab = this.tabPageProgress;

            // Set the controls enabled state.
            this.buttonStart.Enabled = false;

            this.splitContainerNodes.Enabled = false;
            this.splitContainerCommands.Enabled = false;

            // Show the progress dialog.
            this.progress.Show(Resources.GlobeClock_48, "Starting the PlanetLab commands...");
            // Log.
            this.controlLog.Add(this.config.Log.Add(
                LogEventLevel.Verbose,
                LogEventType.Information,
                ControlSliceRun.logSource.FormatWith(this.slice.Id),
                "Starting the PlanetLab commands."));
            // Status.
            this.status.Send(ApplicationStatus.StatusType.Busy, "Starting the PlanetLab commands...", Resources.GlobeClock_16);
        }
예제 #3
0
        /// <summary>
        /// An event handler called when the run has stopped.
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnRunStopped(object sender, PlManagerEventArgs e)
        {
            // Wait for the tool method to complete.
            this.toolWait.WaitOne();

            this.Invoke(() =>
            {
                // Release the status lock.
                this.status.Unlock();

                // Set the controls enabled state.
                this.buttonStart.Enabled = true;

                this.splitContainerNodes.Enabled = true;
                this.splitContainerCommands.Enabled = true;

                // Show the progress dialog.
                this.progress.Show(Resources.GlobePlayStop_48, "The PlanetLab commands stopped.", false);
                // Log.
                this.controlLog.Add(this.config.Log.Add(
                    LogEventLevel.Verbose,
                    LogEventType.Success,
                    ControlSliceRun.logSource.FormatWith(this.slice.Id),
                    "The PlanetLab commands stopped successfully."));
                // Status.
                this.status.Send(ApplicationStatus.StatusType.Normal, "The PlanetLab commands stopped.", Resources.GlobePlayStop_16);

                // Clear the state information.
                lock (this.managerSync)
                {
                    // Add the state information to the manager history.
                    PlManagerHistoryId historyId = this.managerHistory.Add(this.managerState);
                    // Add the history identifier to the history tab.
                    this.OnAddHistory(historyId);
                    // Dispose the manager.
                    this.managerState.Dispose();
                    this.managerState = null;
                }
            });
        }
예제 #4
0
        /// <summary>
        /// An event handler called when the run has started.
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnRunStarted(object sender, PlManagerEventArgs e)
        {
            this.Invoke(() =>
                {
                    // Set the controls enabled state.
                    this.buttonPause.Enabled = true;
                    this.buttonStop.Enabled = true;

                    // Show the progress dialog.
                    this.progress.Show(Resources.GlobePlayStart_48, "Running the PlanetLab commands.", false);
                    // Log.
                    this.controlLog.Add(this.config.Log.Add(
                        LogEventLevel.Verbose,
                        LogEventType.Success,
                        ControlSliceRun.logSource.FormatWith(this.slice.Id),
                        "The PlanetLab commands started sucessfully."));
                    // Status.
                    this.status.Send(ApplicationStatus.StatusType.Busy, "Running the PlanetLab commands.", Resources.GlobePlayStart_16);

                    // Send the session information to the connected tools.
                    this.OnSendSessionTools();
                });
        }
예제 #5
0
        /// <summary>
        /// An event handler called when the run is resuming.
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnRunResuming(object sender, PlManagerEventArgs e)
        {
            this.Invoke(() =>
                {
                    // Set the controls enabled state.
                    this.buttonStart.Enabled = false;

                    // Show the progress dialog.
                    this.progress.Show(Resources.GlobeClock_48, "Resuming the PlanetLab commands...");
                    // Log.
                    this.controlLog.Add(this.config.Log.Add(
                        LogEventLevel.Verbose,
                        LogEventType.Information,
                        ControlSliceRun.logSource.FormatWith(this.slice.Id),
                        "Resuming the PlanetLab commands."));
                    // Status.
                    this.status.Send(ApplicationStatus.StatusType.Busy, "Resuming the PlanetLab commands...", Resources.GlobeClock_16);
                });
        }
예제 #6
0
 /// <summary>
 /// An event handler called when started updating the PlanetLab nodes information.
 /// </summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The event arguments.</param>
 private void OnNodesUpdateStarted(object sender, PlManagerEventArgs e)
 {
     // Show the progress.
     this.progress.Show(Resources.GlobeClock_48, "Updating the information for the selected PlanetLab nodes.");
     // Log.
     this.controlLog.Add(this.config.Log.Add(
         LogEventLevel.Verbose,
         LogEventType.Information,
         ControlSliceRun.logSource.FormatWith(this.slice.Id),
         "Updating the information for the selected PlanetLab nodes."));
 }
예제 #7
0
 /// <summary>
 /// An event handler called when finished updating the PlanetLab nodes information, and the operation succeeded.
 /// </summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The event arguments.</param>
 private void OnNodesUpdateFinishedSuccess(object sender, PlManagerEventArgs e)
 {
     // Show the progress.
     this.progress.Show(Resources.GlobeSuccess_48, "Updating the information for the selected PlanetLab nodes completed successfully.", false);
     // Log.
     this.controlLog.Add(this.config.Log.Add(
         LogEventLevel.Verbose,
         LogEventType.Success,
         ControlSliceRun.logSource.FormatWith(this.slice.Id),
         "Updating the information for the selected PlanetLab nodes completed successfully."));
 }
예제 #8
0
        /// <summary>
        /// An event handler called when finished updating the PlanetLab nodes information, and the operation failed.
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnNodesUpdateFinishedFail(object sender, PlManagerEventArgs e)
        {
            // Show the progress.
            this.progress.Show(Resources.GlobeError_48, "Updating the information for the selected PlanetLab nodes failed.", false);

            if (e.Exception != null)
            {
                // Log.
                this.controlLog.Add(this.config.Log.Add(
                    LogEventLevel.Important,
                    LogEventType.Error,
                    ControlSliceRun.logSource.FormatWith(this.slice.Id),
                    "Updating the information for the selected PlanetLab nodes failed. {0}",
                    new object[] { e.Exception.Message },
                    e.Exception));
            }
            else if (string.IsNullOrWhiteSpace(e.Message))
            {
                // Log.
                this.controlLog.Add(this.config.Log.Add(
                    LogEventLevel.Important,
                    LogEventType.Error,
                    ControlSliceRun.logSource.FormatWith(this.slice.Id),
                    "Updating the information for the selected PlanetLab nodes failed. {0}",
                    new object[] { e.Message }));
            }
        }