private async void Move2Position(VsmdAxis axis, int val)
        {
            var spd = VsmdController.GetVsmdController().GetAxis(axis).GetAttributeValue(VsmdLib.VsmdAttribute.Spd);
            await VsmdController.GetVsmdController().SetSpeed(axis, spd);

            await VsmdController.GetVsmdController().MoveTo(axis, val);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="axis"></param>
        /// <param name="coord">start from 1</param>
        /// <returns></returns>
        public int Convert2PhysicalPos(VsmdAxis axis, int block, int coord)
        {
            int fpox = 0;

            switch (axis)
            {
            case VsmdAxis.X:
                if (m_curBoard.Type == (int)BoardType.Site)
                {
                    fpox = m_curBoard.Site1FirstTubeX + (int)((coord - 1) * m_tubeDistX);
                }
                else
                {
                    fpox = m_curBoard.GridFirstTubeX + (int)((block - 1) * m_tubeDistX);
                }
                break;

            case VsmdAxis.Y:
                if (m_curBoard.Type == (int)BoardType.Site)
                {
                    fpox = m_curBoard.Site1FirstTubeY + (block - 1) * m_siteDistY + (int)((coord - 1) * m_tubeDistY);
                }
                else
                {
                    fpox = m_curBoard.GridFirstTubeY + (int)((coord - 1) * m_tubeDistY);
                }
                break;

            default:
                break;
            }
            return(fpox);
        }
        private async Task <bool> StsImpl(VsmdAxis axis)
        {
            await VsmdController.GetVsmdController().Sts(axis);

            string newPos = VsmdController.GetVsmdController().GetAxis(axis).curPos.ToString();

            switch (axis)
            {
            case VsmdAxis.X:
                txtPosX.Text = newPos;
                break;

            case VsmdAxis.Y:
                txtPosY.Text = newPos;
                break;

            case VsmdAxis.Z:
                txtPosZ.Text = newPos;
                break;

            default:
                break;
            }
            return(true);
        }
示例#4
0
 public async Task <bool> SetSpeed(VsmdAxis axis, float speed)
 {
     if (speed == 0.0)
     {
         //System.Windows.Forms.MessageBox.Show("dangrous!!! set speed to zero!");
     }
     return(await GetAxis(axis).cfgSpd(speed));
 }
        private void ShowSetDlg(TextBox textbox, VsmdAxis axisType)
        {
            SetTubePositionFrm frm = new SetTubePositionFrm(axisType);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                textbox.Text = frm.GetPos().ToString();
            }
        }
示例#6
0
        public async Task <bool> MoveTo(VsmdAxis axis, int pos)
        {
            bool ret = await GetAxis(axis).moveto(pos);

            //if(!ret && axis == VsmdAxis.Z)
            //{
            //    if(GetAxis(axis).curPos == 0 && pos > 0)
            //    {
            //        GetAxis(axis).SendCommand("3 zero start");
            //        await Task.Delay(30);
            //        GetAxis(axis).SendCommand("3 zero stop");
            //        await ZeroStop(axis);
            //        ret = await MoveTo(axis, pos);
            //    }
            //}
            return(ret);
        }
        private async Task <bool> SaveImpl(VsmdAxis axis)
        {
            switch (axis)
            {
            case VsmdAxis.X:
                if (!string.IsNullOrWhiteSpace(txtSpeedX.Text))
                {
                    await VsmdController.GetVsmdController().SetSpeed(axis, float.Parse(txtSpeedX.Text));
                }
                if (!string.IsNullOrWhiteSpace(txtZsdX.Text))
                {
                    await VsmdController.GetVsmdController().SetZsd(axis, float.Parse(txtZsdX.Text));
                }
                break;

            case VsmdAxis.Y:
                if (!string.IsNullOrWhiteSpace(txtSpeedY.Text))
                {
                    await VsmdController.GetVsmdController().SetSpeed(axis, float.Parse(txtSpeedY.Text));
                }
                if (!string.IsNullOrWhiteSpace(txtZsdY.Text))
                {
                    await VsmdController.GetVsmdController().SetZsd(axis, float.Parse(txtZsdY.Text));
                }
                break;

            case VsmdAxis.Z:
                if (!string.IsNullOrWhiteSpace(txtSpeedZ.Text))
                {
                    await VsmdController.GetVsmdController().SetSpeed(axis, float.Parse(txtSpeedZ.Text));
                }
                if (!string.IsNullOrWhiteSpace(txtZsdX.Text))
                {
                    await VsmdController.GetVsmdController().SetZsd(axis, float.Parse(txtZsdZ.Text));
                }
                break;

            default:
                break;
            }

            return(true);
        }
示例#8
0
        public VsmdInfoSync GetAxis(VsmdAxis axis)
        {
            VsmdInfoSync ret = null;

            switch (axis)
            {
            case VsmdAxis.X:
                ret = m_axisX;
                break;

            case VsmdAxis.Y:
                ret = m_axisY;
                break;

            case VsmdAxis.Z:
                ret = m_axisZ;
                break;

            default:
                break;
            }
            return(ret);
        }
示例#9
0
 public async Task <bool> ZeroStop(VsmdAxis axis)
 {
     return(await GetAxis(axis).zeroStop());
 }
        private async Task <bool> MoveImpl(VsmdAxis axis, float speed)
        {
            await VsmdController.GetVsmdController().SetSpeed(axis, speed);

            return(await VsmdController.GetVsmdController().Move(axis));
        }
示例#11
0
 public async Task <bool> ZeroStart(VsmdAxis axis)
 {
     //await m_vsmdController.SetZsd(axis, 1200);
     return(await GetAxis(axis).zeroStart());
 }
示例#12
0
 public async Task <bool> Off(VsmdAxis axis)
 {
     return(await GetAxis(axis).disable());
 }
示例#13
0
 public async Task <bool> Move(VsmdAxis axis)
 {
     return(await GetAxis(axis).move());
 }
 private async Task <bool> PosImpl(VsmdAxis axis, TextBoxEx boxCtrl)
 {
     return(await VsmdController.GetVsmdController().Pos(axis, int.Parse(boxCtrl.Text.Trim())));
 }
示例#15
0
 public async Task <bool> Ena(VsmdAxis axis)
 {
     return(await GetAxis(axis).enable());
 }
 private async Task <bool> OffImpl(VsmdAxis axis)
 {
     return(await VsmdController.GetVsmdController().Off(axis));
 }
示例#17
0
 public async Task <bool> Dev(VsmdAxis axis)
 {
     return(await GetAxis(axis).dev());
 }
示例#18
0
 public async Task <bool> Cfg(VsmdAxis axis)
 {
     return(await GetAxis(axis).cfg());
 }
示例#19
0
 public async Task <bool> SetS3Mode(VsmdAxis axis, int mode)
 {
     return(await GetAxis(axis).cfgS3(mode));
 }
 private async void StopImpl(VsmdAxis axis)
 {
     await VsmdController.GetVsmdController().Stop(axis);
 }
 private async void OrgImpl(VsmdAxis axis)
 {
     await VsmdController.GetVsmdController().Org(axis);
 }
        private async Task <bool> ZeroStartImpl(VsmdAxis axis, float speed)
        {
            await VsmdController.GetVsmdController().SetZsd(axis, speed);

            return(await VsmdController.GetVsmdController().ZeroStart(axis));
        }
示例#23
0
 public async Task <bool> Sts(VsmdAxis axis)
 {
     return(await GetAxis(axis).sts());
 }
示例#24
0
 public async Task <bool> Pos(VsmdAxis axis, int pos)
 {
     return(await GetAxis(axis).moveto(pos));
 }
示例#25
0
 public async Task <bool> S3Off(VsmdAxis axis)
 {
     return(await GetAxis(axis).S3Off());
 }
 private async Task <bool> ZeroStopImpl(VsmdAxis axis, float speed)
 {
     return(await VsmdController.GetVsmdController().ZeroStop(axis));
 }
示例#27
0
 public async Task <bool> SetZsd(VsmdAxis axis, float speed)
 {
     return(await GetAxis(axis).cfgZsd(speed));
 }
示例#28
0
 public float GetSpeed(VsmdAxis axis)
 {
     return(GetAxis(axis).curSpd);
 }
 public SetTubePositionFrm(VsmdAxis axis)
 {
     InitializeComponent();
     m_axisType = axis;
     m_inMoving = false;
 }
示例#30
0
        public async Task <bool> ZeroStart(VsmdAxis axis)
        {
            var ret = await GetAxis(axis).zeroStart();

            return(ret);
        }