| | |
| | | private int _axisIndex { get; set; } |
| | | private string _axisName { get; set; } |
| | | |
| | | public AxisMovingStatus _axisMovingStatus = new AxisMovingStatus(); |
| | | public CtrlMotionCardAxisStatus(IDevice device,int axisIndex,string axisName) |
| | | public AxisMovingStatus _axisMovingStatus; |
| | | public CtrlMotionCardAxisStatus(IDevice device, int axisIndex, string axisName) |
| | | { |
| | | InitializeComponent(); |
| | | Device = device; |
| | |
| | | private void RefreshStatus(object sender, EventArgs e) |
| | | { |
| | | _axisMovingStatus = MotionCard.AxisStatusList.FirstOrDefault(u => u.AxisIndex == _axisIndex); |
| | | textBoxPrfPositon.Text = _axisMovingStatus.Destination.ToString(); |
| | | textBoxCurPosition.Text = _axisMovingStatus.CurPosition.ToString(); |
| | | textBoxPrfVel.Text = _axisMovingStatus.PrfVelocity.ToString(); |
| | | textBoxCurVel.Text = _axisMovingStatus.CurVelocity.ToString(); |
| | | int axis_sts = _axisMovingStatus.AxisStatus; |
| | | if (_axisMovingStatus != null) |
| | | { |
| | | textBoxPrfPositon.Text = _axisMovingStatus.CurPosition.ToString(); |
| | | textBoxPrfVel.Text = _axisMovingStatus.PrfVelocity.ToString(); |
| | | textBoxCurVel.Text = _axisMovingStatus.CurVelocity.ToString(); |
| | | int axis_sts = _axisMovingStatus.AxisStatus; |
| | | |
| | | ioIndicatorCtrl1.IsOn = (axis_sts & 0x2) == 0;//驱动报警 |
| | | ioIndicatorCtrl2.IsOn = (axis_sts & 0x200) == 0;//伺服使能 |
| | | ioIndicatorCtrl6.IsOn = (axis_sts & 0x20) == 0;//正限位 |
| | | ioIndicatorCtrl8.IsOn = (axis_sts & 0x40) == 0;//负限位 |
| | | ioIndicatorCtrl9.IsOn = (axis_sts & 0x400) == 0;//运动状态 |
| | | ioIndicatorCtrl10.IsOn = (axis_sts & 0x10) == 0;//运动出错 |
| | | ioIndicatorCtrl1.IsOn = (axis_sts & 0x2) != 0;//驱动报警 |
| | | ioIndicatorCtrl2.IsOn = (axis_sts & 0x200) != 0;//伺服使能 1为开启 |
| | | ioIndicatorCtrl6.IsOn = (axis_sts & 0x20) != 0;//正限位 |
| | | ioIndicatorCtrl8.IsOn = (axis_sts & 0x40) != 0;//负限位 |
| | | ioIndicatorCtrl9.IsOn = (axis_sts & 0x400) != 0;//运动状态 |
| | | ioIndicatorCtrl10.IsOn = (axis_sts & 0x10) != 0;//运动出错 |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |