private void GetMotionSettingUpdate() { try { textBox_MOT_filepath.Text = m_motion.MOTFilePath; int index = comboBox_Axis.SelectedIndex; if (index > -1) { checkBox_use_axis.Checked = m_motion.ListAxis[index].IsUseAxis; textBox_unit_per_mm.Text = String.Format("{0}", m_motion.ListAxis[index].UnitPerMM); textBox_unit_per_mm_encoder.Text = String.Format("{0}", m_motion.ListAxis[index].UnitPerMMEncoder); checkBox_total_unit.Checked = m_motion.ListAxis[index].UnitPerMM == m_motion.ListAxis[index].UnitPerMMEncoder ? true : false; bool enable = true; if (index == m_motion.GantrySlaveAxis && m_motion.GantryGetStatus()) { enable = false; } textBox_unit_per_mm.Enabled = enable; textBox_unit_per_mm_encoder.Enabled = enable; checkBox_use_axis.Enabled = enable; checkBox_total_unit.Enabled = enable; } } catch (Exception E) { LogFile.LogExceptionErr(E.ToString()); MessageBox.Show(E.Message); } }
private void UpdateAxisInfo() { try { if (m_motion != null) { int index = comboBox_Axis.SelectedIndex; if (index >= -1) { checkBox_servo_on.Checked = m_motion.AxisGetServoOnState(index); double vel = m_motion.ListAxis[index].Velocity; double acc = m_motion.ListAxis[index].Acceleration; double dec = m_motion.ListAxis[index].Deceleration; edtMoveVel.Value = Convert.ToDecimal(vel); edtMoveAcc.Value = Convert.ToDecimal(acc); edtMoveDec.Value = Convert.ToDecimal(dec); if (index == m_motion.GantryMasterAxis) { if (m_motion.GantryGetStatus()) { label_gantry_info.Text = "Gantry on"; } else { label_gantry_info.Text = "Gantry off"; } } else { label_gantry_info.Text = ""; } } } } catch (Exception E) { LogFile.LogExceptionErr(E.ToString()); MessageBox.Show(E.Message); } }