so7_config新增脚踏开关使能设置。

This commit is contained in:
TAO Cheng
2014-05-09 11:05:52 +08:00
parent 5aec9f2552
commit 4f6272ff92
14 changed files with 468 additions and 168 deletions
@@ -605,6 +605,7 @@ SSI_STATUS_MOTION CSO7_Proto::so7_config_para_set_default()
g_machine.s_machine_config.motion.m_CNC_Deadlock_Solution=1;
g_machine.s_machine_config.motion.m_CNC_Deadlock_JudgeMaxCnts=6;
g_machine.s_machine_config.motion.m_TouchProbeEnable=0;
g_machine.s_machine_config.motion.m_FootSwitchEnable=0;
g_machine.s_machine_config.motion.m_JoyStickEnable=0;
g_machine.s_machine_config.motion.m_DebugOutputEnable=0;
@@ -2243,6 +2244,10 @@ SSI_STATUS_MOTION CSO7_Proto::Save_So7_Config()
fprintf(m_pOutFile,"%s", outBuff);
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_TouchProbeEnable);
fprintf(m_pOutFile, "\n");
outBuff="FOOT_SWITCH_ENABLE=";
fprintf(m_pOutFile,"%s", outBuff);
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_FootSwitchEnable);
fprintf(m_pOutFile, "\n");
outBuff="JOYSTICK_ENABLE=";
fprintf(m_pOutFile,"%s", outBuff);
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_JoyStickEnable);
@@ -2552,6 +2557,15 @@ SSI_STATUS_MOTION CSO7_Proto::Load_So7_Config()
g_machine.s_machine_config.motion.m_TouchProbeEnable=atoi(cTemp);
}
}
else if (!_stricmp(token,"FOOT_SWITCH_ENABLE"))
{
token = strtok( NULL, seps);
if (token)
{
strcpy(cTemp,token);
g_machine.s_machine_config.motion.m_FootSwitchEnable=atoi(cTemp);
}
}
else if (!_stricmp(token,"JOYSTICK_ENABLE"))
{
token = strtok( NULL, seps);
@@ -2900,6 +2914,7 @@ SSI_STATUS_MOTION CSO7_Proto::Init_SO7Usb()
}
else if (usb_set_configuration(g_dev, MY_CONFIG) < 0)
{
g_dev=NULL;
MessageBox(NULL, _T("Unable to SET CONFIGURATION"), _T("Message"), MB_OK|MB_ICONERROR);
g_machine.IsOffline=TRUE;
rStatus=SSI_STATUS_MOTION_DATALINK_ERROR;
@@ -2907,6 +2922,7 @@ SSI_STATUS_MOTION CSO7_Proto::Init_SO7Usb()
else if (usb_claim_interface(g_dev, 0) < 0)
{
usb_close(g_dev);
g_dev=NULL;
MessageBox(NULL, _T("Unable to CLAIM DEVICE"), _T("Message"), MB_OK|MB_ICONERROR);
g_machine.IsOffline=TRUE;
rStatus=SSI_STATUS_MOTION_DATALINK_ERROR;