SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.cpp
@@ -32,16 +32,70 @@
   m_pPLC = pPLC;
}
void CAxisDetailSettingsDlg::UpdateAxisDetailSettings()
{
   // 获取轴数据
   RecipeManager& recipeManager = RecipeManager::getInstance();
   auto axisDetails = recipeManager.getAxis(m_nAxisNO);
   auto formatDouble = [](double value) -> CString {
      CString str;
      str.Format(_T("%.3f"), value);
      return str;
   };
   auto formatInt = [](int value) -> CString {
      CString str;
      str.Format(_T("%d"), value);
      return str;
   };
   m_staticAxisNO.SetWindowText(CString(axisDetails.number.c_str()));                        // 轴编号
   m_staticAxisDescription.SetWindowText(CString(axisDetails.description.c_str()));            // 轴描述
   m_staticStartAddress.SetWindowText(CString(axisDetails.startAddress.c_str()));               // 起始地址
   GetDlgItem(IDC_EDIT_AXIS_POSITIONING_SPEED_LIMIT)->SetWindowText(formatDouble(axisDetails.maxPositioningSpeed));   // 定位速度上限
   GetDlgItem(IDC_EDIT_AXIS_JOG_SPEED_LIMIT)->SetWindowText(formatDouble(axisDetails.maxManualSpeed));               // 手动速度上限
   GetDlgItem(IDC_EDIT_AXIS_POSITIONING_POINTS)->SetWindowText(formatInt(axisDetails.positioningPointCount));         // 定位点数
   // 微动量
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM_MIN)->SetWindowText(formatDouble(axisDetails.jogDistance.minValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM)->SetWindowText(formatDouble(axisDetails.jogDistance.currentValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM_MAX)->SetWindowText(formatDouble(axisDetails.jogDistance.maxValue));
   // 手动速度
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_POS_MIN)->SetWindowText(formatDouble(axisDetails.manualSpeed.minValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_POS)->SetWindowText(formatDouble(axisDetails.manualSpeed.currentValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_POS_MAX)->SetWindowText(formatDouble(axisDetails.manualSpeed.maxValue));
   // 自动速度
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED_MIN)->SetWindowText(formatDouble(axisDetails.autoSpeed.minValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED)->SetWindowText(formatDouble(axisDetails.autoSpeed.currentValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED_MAX)->SetWindowText(formatDouble(axisDetails.autoSpeed.maxValue));
   // 加速时间
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME_MIN)->SetWindowText(formatDouble(axisDetails.accelerationTime.minValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME)->SetWindowText(formatDouble(axisDetails.accelerationTime.currentValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME_MAX)->SetWindowText(formatDouble(axisDetails.accelerationTime.maxValue));
   // 减速时间
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME_MIN)->SetWindowText(formatDouble(axisDetails.decelerationTime.minValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME)->SetWindowText(formatDouble(axisDetails.decelerationTime.currentValue));
   GetDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME_MAX)->SetWindowText(formatDouble(axisDetails.decelerationTime.maxValue));
}
void CAxisDetailSettingsDlg::DoDataExchange(CDataExchange* pDX)
{
   CDialogEx::DoDataExchange(pDX);
   DDX_Control(pDX, IDC_STATIC_AXIS_NUMBER, m_staticAxisNO);
   DDX_Control(pDX, IDC_STATIC_AXIS_DESCRIP, m_staticAxisDescription);
   DDX_Control(pDX, IDC_STATIC_START_ADDRESS, m_staticStartAddress);
   DDX_Control(pDX, IDC_CUSTOM_AXIS_ANCHOR_POINT, m_gridAxisDetailSettings);
}
BEGIN_MESSAGE_MAP(CAxisDetailSettingsDlg, CDialogEx)
   ON_BN_CLICKED(IDC_BUTTON_AXIS_DETAIL_SETTINGS_SAVE, &CAxisDetailSettingsDlg::OnBnClickedButtonAxisDetailSettingsSave)
END_MESSAGE_MAP()
@@ -67,10 +121,14 @@
      return FALSE;
   }
   m_staticAxisNO.SetWindowText(CString(axisDetails.number.c_str()));                        // 轴编号
   m_staticAxisDescription.SetWindowText(CString(axisDetails.description.c_str()));            // 轴描述
   m_staticStartAddress.SetWindowText(CString(axisDetails.startAddress.c_str()));               // 起始地址
   UpdateAxisDetailSettings();
   return TRUE;  // return TRUE unless you set the focus to a control
   // 异常: OCX 属性页应返回 FALSE
}
void CAxisDetailSettingsDlg::OnBnClickedButtonAxisDetailSettingsSave()
{
   // TODO: 在此添加控件通知处理程序代码
   EndDialog(IDOK);
}