Exemplo n.º 1
0
        public TpsViewEbaraV2()
        {
            //
            // Required for Windows Form Designer support
            //

            try
            {
                //_tpsRm = new TpsResourceManager();
                _tpsRm = new ABB.Robotics.Tps.Resources.TpsResourceManager("TpsViewEbaraV2NameSpace.strings", ABB.Robotics.Taf.Base.TafAssembly.Load("TpsViewEbaraV2Texts.dll"));
                InitializeComponent();
                InitializeTexts();

                // The Install method, which runs after the constructor, creates the robot controller instance and
                // starts the controller subscriptions needed in this view.
            }
            catch (System.Exception ex)
            {
                // If initialization of application fails a message box is shown
                GTPUMessageBox.Show(this.Parent
                                    , null
                                    , string.Format("An unexpected error occurred while starting up Sample Application. \n\n{0}", ex.Message)
                                    , "Sample Application Start-up Error"
                                    , MessageBoxIcon.Hand, MessageBoxButtons.OK);
            }

            //
            // ToDo: Add any constructor code after InitializeComponent call
            //
        }
Exemplo n.º 2
0
        private void menuItem_Apply_Click(object sender, EventArgs e)
        {
            try
            {
                ABB.Robotics.Controllers.RapidDomain.RapidData boolBlocksiFr1ArcStable = rwSystem.Controller.Rapid.GetRapidData("T_ROB1", "GlobalDataModule", "boolBlocksiFr1ArcStable");
                ABB.Robotics.Controllers.RapidDomain.Bool      bBlocksiFr1ArcStable    = new ABB.Robotics.Controllers.RapidDomain.Bool(this.checkBox_boolBlocksiFr1ArcStable.Checked);
                boolBlocksiFr1ArcStable.Value = bBlocksiFr1ArcStable;
                boolBlocksiFr1ArcStable.Dispose();

                ABB.Robotics.Controllers.RapidDomain.RapidData numBlocksiArcStableLength = rwSystem.Controller.Rapid.GetRapidData("T_ROB1", "GlobalDataModule", "numBlocksiArcStableLength");
                ABB.Robotics.Controllers.RapidDomain.Num       nBlocksiArcStableLength   = new ABB.Robotics.Controllers.RapidDomain.Num(Convert.ToDouble(this.numEditor_numBlocksiArcStableLength.Value));
                numBlocksiArcStableLength.Value = nBlocksiArcStableLength;
                numBlocksiArcStableLength.Dispose();

                this.rwSystem.ApplyTpsControl("T_ROB1", "GlobalDataModule", "numIsometricalSaddleCoefficient", this.numEditor_numIsometricalSaddleCoefficient);
                this.rwSystem.ApplyTpsControl("T_ROB1", "GlobalDataModule", "numShoulderGrooveCoefficient", this.numEditor_numShoulderGrooveCoefficient);
                this.rwSystem.ApplyTpsControl("T_ROB1", "GlobalDataModule", "numTorchCleanIntervalCount", this.numEditor_numTorchCleanIntervalCount);

                this.menuItem_Apply.Enabled = false;
            }
            catch (Exception ex)
            {
                GTPUMessageBox.Show(this.Parent.Parent, null
                                    , string.Format("An unexpected error occurred when applying RAPID data 'rPipeGrooveModel'. Message {0}", ex.ToString())
                                    , "System Error"
                                    , System.Windows.Forms.MessageBoxIcon.Hand
                                    , System.Windows.Forms.MessageBoxButtons.OK);
            }
        }
Exemplo n.º 3
0
 private void DisplayErrorMessage(string message)
 {
     // Show GTPUMessageBox on exception
     GTPUMessageBox.Show(this.Parent.Parent, null
                         , string.Format("Unable to open {0} view. \n\nDo the preparations described in 'Prepare signals and RAPID data.doc' and try open the view again.\n\nError message: {1}", "", message)
                         , string.Format("{0}Start-up Error", "")
                         , System.Windows.Forms.MessageBoxIcon.Hand, System.Windows.Forms.MessageBoxButtons.OK);
 }
Exemplo n.º 4
0
 private void button_unLimitSTN1Axis1_Click(object sender, EventArgs e)
 {
     this.rwSystem.Controller.Configuration.Write("3.159", "MOC", "Arm", "M8DM2", "upper_joint_bound");
     this.rwSystem.Controller.Configuration.Write("-3.159", "MOC", "Arm", "M8DM2", "lower_joint_bound");
     GTPUMessageBox.Show(this.Parent
                         , RestartController
                         , "The changes will not take effect until the controller is restarted.\n\nDo you want to restart now?"
                         , "Restart"
                         , MessageBoxIcon.Asterisk, MessageBoxButtons.YesNo);
     //this.rwSystem.Controller.Restart();
 }
Exemplo n.º 5
0
        private void UpdateGUI(object sender, EventArgs e)
        {
            try
            {
                this.pipeGrooveModel.RefreshData(this.rwSystem);
                this.comboBox_numPipeGrooveType.SelectedIndex = this.pipeGrooveModel.numPipeGrooveType - 1;
                this.numEditor_numSeamCenterX.Value           = this.pipeGrooveModel.numSeamCenterX;
                this.numEditor_numSeamNormalAngle.Value       = this.pipeGrooveModel.numSeamNormalAngle;

                RapidData rapidData = rwSystem.Controller.Rapid.GetRapidData("T_ROB1", "CalibDataModule", "wobjCurrent");
                this.wobjCurrent.FillFromString(rapidData.Value.ToString());

                this.numEditor_oframeX.Value = (Decimal)Math.Round(this.wobjCurrent.Oframe.Trans.X, 1);
                this.numEditor_oframeY.Value = (Decimal)Math.Round(this.wobjCurrent.Oframe.Trans.Y, 1);
                this.numEditor_oframeZ.Value = (Decimal)Math.Round(this.wobjCurrent.Oframe.Trans.Z, 1);

                if (this.pipeGrooveModel.numPipeGrooveType >= 3)
                {
                    this.numEditor_WorldXOffset.Value = (Decimal)Math.Round(this.wobjCurrent.Oframe.Trans.Z, 1);

                    double dSeamNormalAngle = 0 - Math.PI * ((double)this.numEditor_numSeamNormalAngle.Value) / 180;

                    double doframeX = this.wobjCurrent.Oframe.Trans.X;
                    double doframeY = this.wobjCurrent.Oframe.Trans.Y;

                    this.numEditor_WorldYOffset.Value = (decimal)Math.Round(doframeX * Math.Cos(dSeamNormalAngle) + doframeY * Math.Sin(dSeamNormalAngle), 1);
                    this.numEditor_WorldZOffset.Value = (decimal)Math.Round(0 - doframeX * Math.Sin(dSeamNormalAngle) + doframeY * Math.Cos(dSeamNormalAngle), 1);
                }
                else
                {
                    this.numEditor_WorldXOffset.Value = (Decimal)Math.Round(this.wobjCurrent.Oframe.Trans.X, 1);
                    this.numEditor_WorldYOffset.Value = (Decimal)Math.Round(this.wobjCurrent.Oframe.Trans.Y, 1);
                    this.numEditor_WorldZOffset.Value = (Decimal)Math.Round(this.wobjCurrent.Oframe.Trans.Z, 1);
                }

                this.menuItem_Apply.Enabled = false;
            }
            catch (Exception ex)
            {
                GTPUMessageBox.Show(this.Parent.Parent, null
                                    , string.Format("An unexpected error occurred when reading RAPID data 'rPipeGrooveModel'. Message {0}", ex.ToString())
                                    , "System Error"
                                    , System.Windows.Forms.MessageBoxIcon.Hand
                                    , System.Windows.Forms.MessageBoxButtons.OK);
            }
        }
Exemplo n.º 6
0
 public TpsFormSetting(TpsResourceManager rM, RWSystem rwSystem)
 {
     try
     {
         InitializeComponent();
         this._tpsRm   = rM;
         this.rwSystem = rwSystem;
         InitializeTexts();
     }
     catch (System.Exception ex)
     {
         // If initialization of application fails a message box is shown
         GTPUMessageBox.Show(this.Parent
                             , null
                             , string.Format("An unexpected error occurred while starting up Sample Application. \n\n{0}", ex.Message)
                             , "Sample Application Start-up Error"
                             , MessageBoxIcon.Hand, MessageBoxButtons.OK);
     }
 }
Exemplo n.º 7
0
        private void menuItem_Apply_Click(object sender, EventArgs e)
        {
            try
            {
                this.wobjCurrent.Oframe.Trans.X = (float)this.numEditor_oframeX.Value;
                this.wobjCurrent.Oframe.Trans.Y = (float)this.numEditor_oframeY.Value;
                this.wobjCurrent.Oframe.Trans.Z = (float)this.numEditor_oframeZ.Value;

                RapidData rapidData = rwSystem.Controller.Rapid.GetRapidData("T_ROB1", "CalibDataModule", "wobjCurrent");
                rapidData.Value = this.wobjCurrent;

                this.menuItem_Apply.Enabled = false;
            }
            catch (Exception ex)
            {
                GTPUMessageBox.Show(this.Parent.Parent, null
                                    , string.Format("An unexpected error occurred when applying RAPID data 'rPipeGrooveModel'. Message {0}", ex.ToString())
                                    , "System Error"
                                    , System.Windows.Forms.MessageBoxIcon.Hand
                                    , System.Windows.Forms.MessageBoxButtons.OK);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// This is where you clean up any remaining resources used by your application before
        /// the application itself is disposed of by the host (TAF - TeachPendant Application Framework).
        /// The method is called by the host when the application is closed down.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                try
                {
                    if (disposing)
                    {
                        //ToDo: Call the Dispose method of all FP SDK instances that may otherwise cause memory leak

                        if (this.rwSystem != null)
                        {
                            this.rwSystem.Dispose();
                            this.rwSystem = null;
                        }
                        if (this._viewPipeGrooveModel != null)
                        {
                            this._viewPipeGrooveModel.Dispose();
                            this._viewPipeGrooveModel = null;
                        }
                        if (this._viewSetting != null)
                        {
                            this._viewSetting.Dispose();
                            this._viewSetting = null;
                        }
                        if (this._viewWeldingParameter != null)
                        {
                            this._viewWeldingParameter.Dispose();
                            this._viewWeldingParameter = null;
                        }
                        if (this._viewWobjCurrent != null)
                        {
                            this._viewWobjCurrent.Dispose();
                            this._viewWobjCurrent = null;
                        }
                        if (this._viewLayerParameter != null)
                        {
                            this._viewLayerParameter.Dispose();
                            this._viewLayerParameter = null;
                        }

                        if (this.pipeGrooveModel != null)
                        {
                            this.pipeGrooveModel.Dispose();
                            this.pipeGrooveModel = null;
                        }
                        if (this.weldProcedure != null)
                        {
                            this.weldProcedure.Dispose();
                            this.weldProcedure = null;
                        }
                        if (this.layerParameter != null)
                        {
                            this.layerParameter.Dispose();
                            this.layerParameter = null;
                        }

                        if (this._tpsRm != null)
                        {
                            this._tpsRm = null;
                        }
                    }
                }
                catch (System.Exception ex)
                {
                    GTPUMessageBox.Show(this.Parent.Parent, null
                                        , "An unexpected error occurred while closing down the application.\n\nError message: " + ex.Message
                                        , "Application Error"
                                        , MessageBoxIcon.Hand, MessageBoxButtons.OK);
                }
                finally
                {
                    base.Dispose(disposing);
                }
            }
        }