新增so7_config恢复默认参数功能。

This commit is contained in:
TAO Cheng
2014-03-14 15:24:38 +08:00
parent 34afd5563f
commit 3c52203b7c
11 changed files with 137 additions and 55 deletions
@@ -536,35 +536,6 @@ CSO7_Proto::CSO7_Proto()
g_machine.s_machine_config.zm_axis._SpeedSlow=800;
g_machine.s_machine_config.zm_axis._speed._short_=0;
g_machine.s_machine_config.motion._EnCloseLoop=FALSE;
g_machine.s_machine_config.motion._RetryTimes=0;
g_machine.s_machine_config.motion._ShiftPositionX=0.0;
g_machine.s_machine_config.motion._ShiftPositionY=0.0;
g_machine.s_machine_config.motion._ShiftPositionZ=0.0;
g_machine.s_machine_config.motion._ShiftPositionZ=0.0;
g_machine.s_machine_config.motion.GetInterruptMsgMethod=E_GET_INTERRUPT_MSG_INQUIRY;
g_machine.s_machine_config.motion.m_WriteDataSleepTime=0;
g_machine.s_machine_config.motion.m_AccuraErrPulseX=1;
g_machine.s_machine_config.motion.m_AccuraErrPulseY=1;
g_machine.s_machine_config.motion.m_AccuraErrPulseZ=1;
g_machine.s_machine_config.motion.m_EQUIDIS_X=0;
g_machine.s_machine_config.motion.m_EQUIDIS_Y=0;
g_machine.s_machine_config.motion.m_EQUIDIS_Z=0;
g_machine.s_machine_config.motion.m_TouchProbeEnable=0;
g_machine.s_machine_config.motion.m_JoyStickEnable=0;
g_machine.s_machine_config.motion.m_DebugOutputEnable=0;
g_machine.s_machine_config.motion.m_SDK3000_CntThreadSleepVal=550000;
g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[0]=70;
g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[1]=70;
g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[2]=70;
g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[3]=70;
g_machine.s_machine_config.motion.m_MachineType=MACHINE_SO7_CONTROLLER;
g_machine.s_machine_config.motion.m_VideoCardType=0;
g_machine.s_status._bIsZMMotionFinished=0;
g_machine.x._scale_pos._long_ = 0;
g_machine.y._scale_pos._long_ = 0;
@@ -588,6 +559,7 @@ CSO7_Proto::CSO7_Proto()
g_machine.InterruptFlag[1]=0;
g_machine.InPortStatus=0;
so7_motion_reset_controller_parameter();
so7_config_para_set_default();
m_bHomingActive = false;
g_pLogger = new CLogger(_T("\\UtilityDebug.Log"));
g_pLogger->Send(_T("Construct Cso7_Proto.\r\n"));
@@ -610,6 +582,38 @@ CSO7_Proto::~CSO7_Proto()
//==============================================================================
//******************************************************************************
SSI_STATUS_MOTION CSO7_Proto::so7_config_para_set_default()
{
g_machine.s_machine_config.motion._EnCloseLoop=FALSE;
g_machine.s_machine_config.motion._RetryTimes=0;
g_machine.s_machine_config.motion._ShiftPositionX=0.0;
g_machine.s_machine_config.motion._ShiftPositionY=0.0;
g_machine.s_machine_config.motion._ShiftPositionZ=0.0;
g_machine.s_machine_config.motion._ShiftPositionZ=0.0;
g_machine.s_machine_config.motion.GetInterruptMsgMethod=E_GET_INTERRUPT_MSG_INQUIRY;
g_machine.s_machine_config.motion.m_WriteDataSleepTime=0;
g_machine.s_machine_config.motion.m_AccuraErrPulseX=1;
g_machine.s_machine_config.motion.m_AccuraErrPulseY=1;
g_machine.s_machine_config.motion.m_AccuraErrPulseZ=1;
g_machine.s_machine_config.motion.m_EQUIDIS_X=0;
g_machine.s_machine_config.motion.m_EQUIDIS_Y=0;
g_machine.s_machine_config.motion.m_EQUIDIS_Z=0;
g_machine.s_machine_config.motion.m_TouchProbeEnable=0;
g_machine.s_machine_config.motion.m_JoyStickEnable=0;
g_machine.s_machine_config.motion.m_DebugOutputEnable=0;
g_machine.s_machine_config.motion.m_SDK3000_CntThreadSleepVal=550000;
g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[0]=70;
g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[1]=70;
g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[2]=70;
g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[3]=70;
g_machine.s_machine_config.motion.m_MachineType=MACHINE_SO7_CONTROLLER;
g_machine.s_machine_config.motion.m_VideoCardType=0;
return SSI_STATUS_MOTION_NORMAL;
}
SSI_STATUS_MOTION CSO7_Proto::so7_motion_reset_controller_parameter()
{
for(int i=0;i<5;i++)
@@ -386,6 +386,7 @@ public:
SSI_STATUS_MOTION so7_motion_laser_on_off(bool _bOnOff);
SSI_STATUS_MOTION so7_motion_fixture_on_off(bool _bOnOff);
SSI_STATUS_MOTION so7_motion_fixture_up_down(bool _bOnOff);
SSI_STATUS_MOTION so7_config_para_set_default();
SSI_STATUS_MOTION so7_motion_reset_controller_parameter();
SSI_STATUS_MOTION _get_xyz_index(long & lX, long & lY, long & lZ);
@@ -4229,3 +4229,28 @@ Init:Open device succeed .
_start_machine
Exit: Exit_SO7Usb
Destruct Cso7_Proto.
Construct Cso7_Proto.
Init:Open device succeed .
_start_machine
Exit: Exit_SO7Usb
Destruct Cso7_Proto.
Construct Cso7_Proto.
Init:Open device succeed .
_start_machine
Exit: Exit_SO7Usb
Init:Open device succeed .
_start_machine
Exit: Exit_SO7Usb
Destruct Cso7_Proto.
Construct Cso7_Proto.
Init:Open device succeed .
_start_machine
Exit: Exit_SO7Usb
Destruct Cso7_Proto.
Construct Cso7_Proto.
Destruct Cso7_Proto.
Construct Cso7_Proto.
Init:Open device succeed .
_start_machine
Exit: Exit_SO7Usb
Destruct Cso7_Proto.
@@ -10,9 +10,9 @@ ZOOM_READING_INTERVAL_TIME=60
ZOOM_MOTOR_SPEED_FAST=2000
ZOOM_MOTOR_SPEED_SLOW=800
;
[MOTION]
[CONTROLLER]
CLOSE_LOOP_ENABLED=0
MOTION_RETRY_TIMES=5
MOTION_RETRY_TIMES=0
SHIFT_POSITION_X=0.000000
SHIFT_POSITION_Y=0.000000
SHIFT_POSITION_Z=0.000000
@@ -24,14 +24,18 @@ ACCURA_ERROR_PULSE_Z=1
EQUIDISTANCE_PULSE_X=0
EQUIDISTANCE_PULSE_Y=0
EQUIDISTANCE_PULSE_Z=0
TOUCH_PROBE_ENABLE=0
JOYSTICK_ENABLE=0
DEBUG_LOG_ENABLE=0
;
[VIDEOCARD]
SDK3000_SLEEP_COUNT=550000
SV4000E_DENOISE_PARA_CHANNEL1=100
SV4000E_DENOISE_PARA_CHANNEL1=70
SV4000E_DENOISE_PARA_CHANNEL2=70
SV4000E_DENOISE_PARA_CHANNEL3=60
SV4000E_DENOISE_PARA_CHANNEL3=70
SV4000E_DENOISE_PARA_CHANNEL4=70
;
[HSI]
MACHINE_CONTROLLER_TYPE=0
MACHINE_VIDEOCARD_TYPE=0
;
@@ -17,10 +17,14 @@ IMPLEMENT_DYNAMIC(CEditableListCtrl, CMFCListCtrl)
m_bEditing = FALSE;
m_bColor=TRUE;
m_bModifyFont=TRUE;
m_nMinRow=0;
m_nMinCol=0;
m_nMaxRow=0;
m_nMaxCol=0;
m_nEditableMinRow=0;
m_nEditableMinCol=0;
m_nEditableMaxRow=0;
m_nEditableMaxCol=0;
m_nColorMinRow=0;
m_nColorMinCol=0;
m_nColorMaxRow=0;
m_nColorMaxCol=0;
}
CEditableListCtrl::~CEditableListCtrl()
@@ -52,7 +56,7 @@ COLORREF CEditableListCtrl::OnGetCellBkColor(int nRow, int nColum)
{
return CMFCListCtrl::OnGetCellBkColor(nRow, nColum);
}
if (nRow<=m_nMaxRow)
if (nRow<=m_nColorMaxRow)
{
if (m_bMarkSortedColumn && nColum == m_iSortedColumn)
{
@@ -97,8 +101,8 @@ void CEditableListCtrl::OnLButtonDblClk(UINT nFlags, CPoint point)
{
m_nRow = testinfo.iItem; //被点击表项的行号
m_nCol = testinfo.iSubItem; //被点击表项的列号
if ((m_nMinRow<=m_nRow && m_nRow<=m_nMaxRow)
&& (m_nMinCol<=m_nCol && m_nCol<=m_nMaxCol))
if ((m_nEditableMinRow<=m_nRow && m_nRow<=m_nEditableMaxRow)
&& (m_nEditableMinCol<=m_nCol && m_nCol<=m_nEditableMaxCol))
{
m_bEditing = BeginEditItem();
return;
@@ -148,11 +152,20 @@ BOOL CEditableListCtrl::EndEditItem(BOOL bIsValid)
return TRUE;
}
//===============================================================
BOOL CEditableListCtrl::SetMaxItemIndex(int _iMinRow,int _iMaxRow,int _iMinCol,int _iMaxCol)
BOOL CEditableListCtrl::SetEditableItemRange(int _iMinRow,int _iMaxRow,int _iMinCol,int _iMaxCol)
{
m_nMinRow=_iMinRow;
m_nMinCol=_iMinCol;
m_nMaxRow=_iMaxRow;
m_nMaxCol=_iMaxCol;
m_nEditableMinRow=_iMinRow;
m_nEditableMinCol=_iMinCol;
m_nEditableMaxRow=_iMaxRow;
m_nEditableMaxCol=_iMaxCol;
return TRUE;
}
//===============================================================
BOOL CEditableListCtrl::SetColorStyleItemRange(int _iMinRow,int _iMaxRow,int _iMinCol,int _iMaxCol)
{
m_nColorMinRow=_iMinRow;
m_nColorMinCol=_iMinCol;
m_nColorMaxRow=_iMaxRow;
m_nColorMaxCol=_iMaxCol;
return TRUE;
}
@@ -17,10 +17,14 @@ protected:
CListCtrlItemEdit m_ListCtrlEdit;
int m_nRow; //行号
int m_nCol; //列号
int m_nMinRow;
int m_nMinCol;
int m_nMaxRow;
int m_nMaxCol;
int m_nEditableMinRow;
int m_nEditableMinCol;
int m_nEditableMaxRow;
int m_nEditableMaxCol;
int m_nColorMinRow;
int m_nColorMinCol;
int m_nColorMaxRow;
int m_nColorMaxCol;
BOOL m_bEditing;
BOOL m_bColor;
BOOL m_bModifyFont;
@@ -29,8 +33,9 @@ protected:
public:
BOOL BeginEditItem();
BOOL EndEditItem(BOOL bIsValid=TRUE);
BOOL SetMaxItemIndex(int _iMinRow,int _iMaxRow,int _iMinCol,int _iMaxCol);
BOOL SetEditableItemRange(int _iMinRow,int _iMaxRow,int _iMinCol,int _iMaxCol);
BOOL SetColorStyleItemRange(int _iMinRow,int _iMaxRow,int _iMinCol,int _iMaxCol);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
};
@@ -878,9 +878,10 @@ CAPTION "
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_LIST_SO7_MOTION_CONFIG,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,7,7,462,299
PUSHBUTTON "Cancel",IDC_BUTTON_SO7_MOTION_CONFIG_CANCEL,364,425,50,19,NOT WS_VISIBLE
PUSHBUTTON "Cancel",IDC_BUTTON_SO7_MOTION_CONFIG_CANCEL,310,425,50,19,NOT WS_VISIBLE
PUSHBUTTON "±£´æ",IDC_BUTTON_SO7_MOTION_CONFIG_OK,419,425,50,19
EDITTEXT IDC_EDIT_SO7_MOTION_CONFIG_MSGOUT,7,317,462,96,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
PUSHBUTTON "恢复默认",IDC_BUTTON_SO7_MOTION_CONFIG_SET_DEFAULT,365,425,50,19
END
IDD_DIALOG_KEYENCE_LKG5000_ETHERNET DIALOGEX 0, 0, 454, 366
@@ -35,6 +35,7 @@ void CSetSo7MotionConfig::DoDataExchange(CDataExchange* pDX)
BEGIN_MESSAGE_MAP(CSetSo7MotionConfig, CMFCPropertyPage)
ON_BN_CLICKED(IDC_BUTTON_SO7_MOTION_CONFIG_OK, &CSetSo7MotionConfig::OnBnClickedButtonSo7MotionConfigOk)
ON_BN_CLICKED(IDC_BUTTON_SO7_MOTION_CONFIG_CANCEL, &CSetSo7MotionConfig::OnBnClickedButtonSo7MotionConfigCancel)
ON_BN_CLICKED(IDC_BUTTON_SO7_MOTION_CONFIG_SET_DEFAULT, &CSetSo7MotionConfig::OnBnClickedButtonSo7MotionConfigSetDefault)
END_MESSAGE_MAP()
@@ -60,7 +61,8 @@ BOOL CSetSo7MotionConfig::OnInitDialog()
}
UpdateLabelName();
UpdateDataValue();
m_ConfigList.SetMaxItemIndex(0,20,2,2);
m_ConfigList.SetEditableItemRange(0,20,2,2);
m_ConfigList.SetColorStyleItemRange(0,22,0,3);
return TRUE;
}
@@ -194,6 +196,18 @@ void CSetSo7MotionConfig::UpdateLabelName()
cStr="SV4000E降噪参数;有效范围:5-100;默认值:70";
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
iRow++;
cStr="MACHINE_CONTROLLER_TYPE";
m_ConfigList.SetItemText(iRow,iCol,cStr);
cStr="控制器类型;保留项;默认值:0";
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
iRow++;
cStr="MACHINE_VIDEOCARD_TYPE";
m_ConfigList.SetItemText(iRow,iCol,cStr);
cStr="视频卡类型;保留项;默认值:0";
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
iRow++;
}
void CSetSo7MotionConfig::UpdateDataValue()
{
@@ -243,6 +257,12 @@ void CSetSo7MotionConfig::UpdateDataValue()
m_ConfigList.SetItemText(iRow++,iCol,cStr);
cStr.Format(_T("%d"),m_pSO7_Proto->g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[3]);
m_ConfigList.SetItemText(iRow++,iCol,cStr);
cStr.Format(_T("%d"),m_pSO7_Proto->g_machine.s_machine_config.motion.m_MachineType);
m_ConfigList.SetItemText(iRow++,iCol,cStr);
cStr.Format(_T("%d"),m_pSO7_Proto->g_machine.s_machine_config.motion.m_VideoCardType);
m_ConfigList.SetItemText(iRow++,iCol,cStr);
}
void CSetSo7MotionConfig::SaveDataValue()
{
@@ -348,6 +368,11 @@ void CSetSo7MotionConfig::OnBnClickedButtonSo7MotionConfigOk()
m_csMsg=_T("配置文件保存在:")+m_csMsg+_T("\\so7_config.ini。");
OutputWithScroll(m_csMsg,m_edit_MsgOut);
}
void CSetSo7MotionConfig::OnBnClickedButtonSo7MotionConfigSetDefault()
{
m_pSO7_Proto->so7_config_para_set_default();
UpdateDataValue();
}
void CSetSo7MotionConfig::OnBnClickedButtonSo7MotionConfigCancel()
@@ -385,4 +410,5 @@ BOOL CSetSo7MotionConfig::PreTranslateMessage(MSG* pMsg)
}
}
return CDialog::PreTranslateMessage(pMsg);
}
}
@@ -28,4 +28,5 @@ public:
CEdit m_edit_MsgOut;
afx_msg void OnBnClickedButtonSo7MotionConfigOk();
afx_msg void OnBnClickedButtonSo7MotionConfigCancel();
afx_msg void OnBnClickedButtonSo7MotionConfigSetDefault();
};
@@ -652,6 +652,8 @@
#define IDC_BTN_KEYENCE_LKG5000_ETHERNET_READOUT1 1542
#define IDC_BUTTON_STOP_SAMPLE_SCURVE 1543
#define IDC_BTN_KEYENCE_LKG5000_ETHERNET_READOUT2 1543
#define IDC_BUTTON_SO7_MOTION_CONFIG_OK2 1543
#define IDC_BUTTON_SO7_MOTION_CONFIG_SET_DEFAULT 1543
#define IDC_BTN_CONFIGURE_MOVEVOUT 1544
#define IDC_BUTTON_STOP_SCAN_KEYENCE_LK_GLASER 1545
#define IDC_BUTTON_SET_TRIGGER 1546