예제 #1
0
        private void button_wobjCurrent_Click(object sender, EventArgs e)
        {
            try
            {
                // Wait cursor if it is performance demanding to open the view...
                Cursor.Current = Cursors.WaitCursor;

                // Set active view
                _activeView = ActiveView.WobjCurrent;

                // Create view
                _viewWobjCurrent = new TpsFormWobjCurrent(this._tpsRm, this.rwSystem, this.pipeGrooveModel);

                // Set up subscription to Closing event of Production view
                _viewWobjCurrent.Closing += new System.ComponentModel.CancelEventHandler(_onViewClosing);
                _viewWobjCurrent.Closed  += new EventHandler(_viewClosed);
                _viewWobjCurrent.ShowMe(this);

                // Ask Production view to set up its subscriptions to controller events
                _viewWobjCurrent.Activate();
            }
            catch (System.Exception ex)
            {
                DisplayErrorMessage(ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
예제 #2
0
        /// <summary>
        /// This method is called by TAF when the control goes from the passive state to the active state,
        /// i.e. becomes visible in the client view. Normally, this is where subscriptions to controller events are set up.
        /// </summary>
        void ITpsViewActivation.Activate()
        {
            try
            {
                if (_activeView == ActiveView.Desktop) // If first view is active
                {
                    //this.pictureBox_Logo.Image = Properties.Resources.Logo;
                }
                else if (_activeView == ActiveView.PipeGrooveModel)
                {
                    _viewPipeGrooveModel.Activate();
                }
                else if (_activeView == ActiveView.Setting)
                {
                    _viewSetting.Activate();
                }
                else if (_activeView == ActiveView.WeldingParameter)
                {
                    _viewWeldingParameter.Activate();
                }
                else if (_activeView == ActiveView.WobjCurrent)
                {
                    _viewWobjCurrent.Activate();
                }
                else if (_activeView == ActiveView.LayerParameter)
                {
                    _viewLayerParameter.Activate();
                }

                _appInFocus = true;
            }
            catch (Exception ex)
            {
                // Add error message to "ProdScr.log" file
                ErrorHandler.AddErrorMessage(CURRENT_MODULE_NAME, ex.ToString());
                ExceptionHandler.ReThrowException("TpsViewEbara", "ITpsViewActivation.Activate", ex);
            }
        }