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);
        }
Beispiel #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);
        }
Beispiel #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();
            }
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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));
        }
Beispiel #11
0
 public async Task <bool> ZeroStart(VsmdAxis axis)
 {
     //await m_vsmdController.SetZsd(axis, 1200);
     return(await GetAxis(axis).zeroStart());
 }
Beispiel #12
0
 public async Task <bool> Off(VsmdAxis axis)
 {
     return(await GetAxis(axis).disable());
 }
Beispiel #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())));
 }
Beispiel #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));
 }
Beispiel #17
0
 public async Task <bool> Dev(VsmdAxis axis)
 {
     return(await GetAxis(axis).dev());
 }
Beispiel #18
0
 public async Task <bool> Cfg(VsmdAxis axis)
 {
     return(await GetAxis(axis).cfg());
 }
Beispiel #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));
        }
Beispiel #23
0
 public async Task <bool> Sts(VsmdAxis axis)
 {
     return(await GetAxis(axis).sts());
 }
Beispiel #24
0
 public async Task <bool> Pos(VsmdAxis axis, int pos)
 {
     return(await GetAxis(axis).moveto(pos));
 }
Beispiel #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));
 }
Beispiel #27
0
 public async Task <bool> SetZsd(VsmdAxis axis, float speed)
 {
     return(await GetAxis(axis).cfgZsd(speed));
 }
Beispiel #28
0
 public float GetSpeed(VsmdAxis axis)
 {
     return(GetAxis(axis).curSpd);
 }
 public SetTubePositionFrm(VsmdAxis axis)
 {
     InitializeComponent();
     m_axisType = axis;
     m_inMoving = false;
 }
Beispiel #30
0
        public async Task <bool> ZeroStart(VsmdAxis axis)
        {
            var ret = await GetAxis(axis).zeroStart();

            return(ret);
        }