コード例 #1
0
        protected override int RunLoop()
        {
            //in case of manual operations
            Platform.AssertAutoMode(this);

            if (!DoGTCylinder.SetDo(this, true, ignoreOrWaringOrError: true))
            {
                ThrowException($"GT Cylinder SET Fail!");
            }


            //safe height check
            if (Platform.CurPos[2] > 1)
            {
                Log($"{Name} {Platform.Name} Z Height Error: {Platform.CurPos[2]:F2} > 1", LogLevel.Error);
            }

            //read barcode
            VioTransInp.WaitVioAndClear(this);
            {
                var pos = $"Barcode{Project.TypeId}";
                if (Platform.ExistsPos(pos))
                {
                    Platform.Jump(pos, 0);
                    ReadBarcode();
                }
            }
            VioBarcodeFinish.SetVio(this);

            //measure down gt
            VioTransFinish.WaitVioAndClear(this);
            {
                //measure down pos
                MeasureDownGt();

                //reset z axis
                Platform.MoveAbs(2, "Wait");
                Platform.Home(2);

                if (!CfgSettings.Common.OptimizeDownWait)
                {
                    Platform.MoveAbs("Wait", checkLimit: false);
                }
                else
                {
                    Platform.MoveAbs(2, "Wait", checkLimit: false);
                    var pos = $"Barcode{Project.TypeId}";
                    if (Platform.ExistsPos(pos))
                    {
                        Platform.Jump(pos, 0);
                    }

                    Log($"{Platform.Name} Wait At {pos}");
                }
            }
            //set vio finish
            VioMeasureFinish.SetVio(this);

            return(0);
        }