コード例 #1
0
        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);
        }
コード例 #3
0
        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));
 }
コード例 #5
0
        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);
        }
コード例 #7
0
        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());
 }
コード例 #10
0
        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());
 }
コード例 #14
0
 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());
 }
コード例 #16
0
 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));
 }
コード例 #20
0
 private async void StopImpl(VsmdAxis axis)
 {
     await VsmdController.GetVsmdController().Stop(axis);
 }
コード例 #21
0
 private async void OrgImpl(VsmdAxis axis)
 {
     await VsmdController.GetVsmdController().Org(axis);
 }
コード例 #22
0
        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());
 }
コード例 #26
0
 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);
 }
コード例 #29
0
 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);
        }