コード例 #1
0
ファイル: YuMi.cs プロジェクト: david0f/yumi
        private void PrintRapidData(string taskName, string moduleName, string varName)
        {
            try
            {
                rdt = controller.Rapid.GetRapidDataType(taskName, moduleName, varName);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace); Thread.Sleep(5000);
            }
            try
            {
                if (rd != null)
                {
                    rd.Dispose();
                }
                rd = controller.Rapid.GetRapidData(taskName, moduleName, varName);
            }
            catch (Exception e)
            {
                Console.WriteLine("Could not fetch rapid data");
                Console.WriteLine(e.StackTrace);
            }

            if (!string.IsNullOrWhiteSpace(rd.StringValue))
            {
                Console.WriteLine("{0} : {1} ", taskName, rd.StringValue);
            }
            // subscribing to variable change
            rd.ValueChanged += RapidVar_ValueChanged;
        }
コード例 #2
0
        public void RefreshData(RWSystem rwSystem)
        {
            RapidData     rPipeGrooveModel           = rwSystem.Controller.Rapid.GetRapidData(strTaskName, strDataModuleName, strDataName);
            RapidDataType rPipeGrooveModelType       = rwSystem.Controller.Rapid.GetRapidDataType(strTaskName, strDataTypeModuleName, strDataType);
            UserDefined   rPipeGrooveModelUserDefine = new UserDefined(rPipeGrooveModelType);

            rPipeGrooveModelUserDefine.FillFromString(rPipeGrooveModel.Value.ToString());

            int i = 0;

            this.numIndex          = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numPipeGrooveType = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.numSeamCenterX     = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numSeamNormalAngle = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.numHeaderDiameter  = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numHeaderThickness = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numHeaderMaterial  = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.numBranchDiameter  = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numBranchThickness = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numBranchMaterial  = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.numMultiPassTotal    = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numCooperativeRobots = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numPathSource        = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.numReviseScanBranchType = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numReviseScanHeaderType = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.numWeldLegWidth      = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numGrooveGap         = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numBranchGrooveRoot  = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numBranchGrooveAngle = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.numBranchGrooveAngle90 = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numTopHeight90         = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numBottomHeight90      = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numProfCosine          = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.numLayerHeight             = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numLayerPassTotalRoundType = decimal.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.numAlgorithmType           = int.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.boolContinuous = bool.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());
            this.boolUseAlignedSTNbyFixedValue = bool.Parse(rPipeGrooveModelUserDefine.Components[i++].ToString());

            this.strID     = rPipeGrooveModelUserDefine.Components[i++].ToString();
            this.strRemark = rPipeGrooveModelUserDefine.Components[i++].ToString();

            rPipeGrooveModelUserDefine.Dispose();
            rPipeGrooveModelType.Dispose();
            rPipeGrooveModel.Dispose();
        }
コード例 #3
0
ファイル: WeldProcedure.cs プロジェクト: zwj12/TpsViewEbaraV2
        public void RefreshData(RWSystem rwSystem, int intGroupIndex, int intIndex)
        {
            this.intGroupIndex = intGroupIndex;
            this.intIndex      = intIndex;

            RapidData rWeldProcedureArray = rwSystem.Controller.Rapid.GetRapidData(strTaskName, strDataModuleName, strDataName + this.intGroupIndex);
            //RapidDataType rWeldProcedureType = rwSystem.Controller.Rapid.GetRapidDataType(strTaskName, strDataTypeModuleName, strDataType);
            UserDefined rWeldProcedure = (UserDefined)rWeldProcedureArray.ReadItem(this.intIndex);

            int i = 0;

            this.strWeldProcedureID = rWeldProcedure.Components[i++].ToString();
            this.strWeldProcedureID = this.strWeldProcedureID.Substring(1, this.strWeldProcedureID.Length - 2);

            this.numWeldSpeed = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numPreFlow   = decimal.Parse(rWeldProcedure.Components[i++].ToString());

            this.numSche         = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numTrackCurrent = decimal.Parse(rWeldProcedure.Components[i++].ToString());

            this.numPostFlow   = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numWeaveShape = int.Parse(rWeldProcedure.Components[i++].ToString());
            this.numWeaveType  = int.Parse(rWeldProcedure.Components[i++].ToString());

            this.numWeaveLength = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numWeaveWidth  = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numWeaveHeigth = decimal.Parse(rWeldProcedure.Components[i++].ToString());

            this.numDwellLeft   = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numDwellCenter = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numDwellRight  = decimal.Parse(rWeldProcedure.Components[i++].ToString());

            this.numWeaveDir  = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numWeaveTilt = decimal.Parse(rWeldProcedure.Components[i++].ToString());

            this.numWeaveOri  = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numWeaveBias = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numTrackType = int.Parse(rWeldProcedure.Components[i++].ToString());
            this.numGainY     = decimal.Parse(rWeldProcedure.Components[i++].ToString());

            this.numGainZ        = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numPenetration  = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numTrackBias    = decimal.Parse(rWeldProcedure.Components[i++].ToString());
            this.numWeaveWidth90 = decimal.Parse(rWeldProcedure.Components[i++].ToString());

            this.strRemark = rWeldProcedure.Components[i++].ToString();
            this.strRemark = this.strRemark.Substring(1, this.strRemark.Length - 2);

            //rWeldProcedureType.Dispose();
            rWeldProcedure.Dispose();
            rWeldProcedureArray.Dispose();
        }
コード例 #4
0
        public void ApplyData(RWSystem rwSystem)
        {
            RapidData     rLayerParameter           = rwSystem.Controller.Rapid.GetRapidData(strTaskName, strDataModuleName, string.Format("{0}{1:00}", strDataName, this.intLayerNo));
            RapidDataType rLayerParameterType       = rwSystem.Controller.Rapid.GetRapidDataType(strTaskName, strDataTypeModuleName, strDataType);
            UserDefined   rLayerParameterUserDefine = new UserDefined(rLayerParameterType);

            rLayerParameterUserDefine.FillFromString(this.ToString());
            ErrorHandler.AddErrorMessage("MichaelLog", this.ToString());
            rLayerParameter.Value = rLayerParameterUserDefine;

            rLayerParameterUserDefine.Dispose();
            rLayerParameterType.Dispose();
            rLayerParameter.Dispose();
        }
コード例 #5
0
        public void ApplyData(RWSystem rwSystem)
        {
            RapidData     rPipeGrooveModel           = rwSystem.Controller.Rapid.GetRapidData(strTaskName, strDataModuleName, strDataName);
            RapidDataType rPipeGrooveModelType       = rwSystem.Controller.Rapid.GetRapidDataType(strTaskName, strDataTypeModuleName, strDataType);
            UserDefined   rPipeGrooveModelUserDefine = new UserDefined(rPipeGrooveModelType);

            rPipeGrooveModelUserDefine.FillFromString(this.ToString());
            ErrorHandler.AddErrorMessage("MichaelLog", this.ToString());
            rPipeGrooveModel.Value = rPipeGrooveModelUserDefine;

            rPipeGrooveModelUserDefine.Dispose();
            rPipeGrooveModelType.Dispose();
            rPipeGrooveModel.Dispose();
        }
コード例 #6
0
ファイル: WeldProcedure.cs プロジェクト: zwj12/TpsViewEbaraV2
        public void ApplyData(RWSystem rwSystem)
        {
            RapidData rWeldProcedureArray = rwSystem.Controller.Rapid.GetRapidData(strTaskName, strDataModuleName, strDataName + this.intGroupIndex);
            //RapidDataType rWeldProcedureType = rwSystem.Controller.Rapid.GetRapidDataType(strTaskName, strDataTypeModuleName, strDataType);
            UserDefined rWeldProcedure = (UserDefined)rWeldProcedureArray.ReadItem(this.intIndex);

            rWeldProcedure.FillFromString(this.ToString());
            ErrorHandler.AddErrorMessage("MichaelLog", this.ToString());
            rWeldProcedureArray.WriteItem(rWeldProcedure, this.intIndex);

            //rWeldProcedureType.Dispose();
            rWeldProcedure.Dispose();
            rWeldProcedureArray.Dispose();
        }
コード例 #7
0
        public void RefreshData(RWSystem rwSystem, int intLayerNo)
        {
            this.intLayerNo = intLayerNo;

            RapidData     rLayerParameter           = rwSystem.Controller.Rapid.GetRapidData(strTaskName, strDataModuleName, string.Format("{0}{1:00}", strDataName, this.intLayerNo));
            RapidDataType rLayerParameterType       = rwSystem.Controller.Rapid.GetRapidDataType(strTaskName, strDataTypeModuleName, strDataType);
            UserDefined   rLayerParameterUserDefine = new UserDefined(rLayerParameterType);

            rLayerParameterUserDefine.FillFromString(rLayerParameter.Value.ToString());

            int i = 0;

            this.numWorkAngleDeclination = int.Parse(rLayerParameterUserDefine.Components[i++].ToString());
            //ErrorHandler.AddErrorMessage("MichaelLog", rLayerParameterUserDefine.Components[i].ToString());

            this.rCircleOffsetX.RefreshData(rwSystem, rLayerParameterUserDefine.Components[i++].ToString());
            this.rCircleOffsetZ.RefreshData(rwSystem, rLayerParameterUserDefine.Components[i++].ToString());
            this.rCircleRotationX.RefreshData(rwSystem, rLayerParameterUserDefine.Components[i++].ToString());
            this.rCircleRotationY.RefreshData(rwSystem, rLayerParameterUserDefine.Components[i++].ToString());
            this.rCircleRotationZ.RefreshData(rwSystem, rLayerParameterUserDefine.Components[i++].ToString());

            this.strLayerParameterID = rLayerParameterUserDefine.Components[i++].ToString();
            this.strLayerParameterID = this.strLayerParameterID.Substring(1, this.strLayerParameterID.Length - 2);

            rLayerParameterUserDefine.Dispose();
            rLayerParameterType.Dispose();
            rLayerParameter.Dispose();

            //DataRow row = this.CircleTable.Rows.Find("OffsetX");
            //row[1] = this.circleOffsetX.numDegree0;
            //row[2] = this.circleOffsetX.numDegree90;
            //row[3] = this.circleOffsetX.numDegree180;
            //row[4] = this.circleOffsetX.numDegree270;
            //row[5] = this.circleOffsetX.numCurveType;

            //row = this.CircleTable.Rows.Find("OffsetZ");
            //row[1] = this.circleOffsetZ.numDegree0;
            //row[2] = this.circleOffsetZ.numDegree90;
            //row[3] = this.circleOffsetZ.numDegree180;
            //row[4] = this.circleOffsetZ.numDegree270;
            //row[5] = this.circleOffsetZ.numCurveType;

            //row = this.CircleTable.Rows.Find("RotationX");
            //row[1] = this.circleRotationX.numDegree0;
            //row[2] = this.circleRotationX.numDegree90;
            //row[3] = this.circleRotationX.numDegree180;
            //row[4] = this.circleRotationX.numDegree270;
            //row[5] = this.circleRotationX.numCurveType;

            //row = this.CircleTable.Rows.Find("RotationY");
            //row[1] = this.circleRotationY.numDegree0;
            //row[2] = this.circleRotationY.numDegree90;
            //row[3] = this.circleRotationY.numDegree180;
            //row[4] = this.circleRotationY.numDegree270;
            //row[5] = this.circleRotationY.numCurveType;

            //row = this.CircleTable.Rows.Find("RotationZ");
            //row[1] = this.circleRotationZ.numDegree0;
            //row[2] = this.circleRotationZ.numDegree90;
            //row[3] = this.circleRotationZ.numDegree180;
            //row[4] = this.circleRotationZ.numDegree270;
            //row[5] = this.circleRotationZ.numCurveType;
        }