新增光栅尺、限位位置设置。
This commit is contained in:
@@ -511,16 +511,6 @@ CSO7_Proto::CSO7_Proto()
|
||||
g_machine.Light_Size=0;
|
||||
g_machine.Light_Switch=0;
|
||||
g_machine.SEQ_NUMBER=0;
|
||||
g_machine.s_machine_config.x_axis._scale_resolution=0.5;
|
||||
g_machine.s_machine_config.y_axis._scale_resolution=0.5;
|
||||
g_machine.s_machine_config.z_axis._scale_resolution=0.5;
|
||||
|
||||
g_machine.s_machine_config.x_axis._neg_working_limit=0;
|
||||
g_machine.s_machine_config.x_axis._pos_working_limit=400;
|
||||
g_machine.s_machine_config.y_axis._neg_working_limit=0;
|
||||
g_machine.s_machine_config.y_axis._pos_working_limit=300;
|
||||
g_machine.s_machine_config.z_axis._neg_working_limit=0;
|
||||
g_machine.s_machine_config.z_axis._pos_working_limit=200;
|
||||
|
||||
g_machine.s_machine_config.x_axis._MoveToSpeed[0]=0.0;
|
||||
g_machine.s_machine_config.x_axis._MoveToSpeed[1]=0.0;
|
||||
@@ -624,9 +614,21 @@ SSI_STATUS_MOTION CSO7_Proto::so7_config_para_set_default()
|
||||
g_machine.s_machine_config.motion.m_MachineType=MACHINE_SO7_CONTROLLER;
|
||||
g_machine.s_machine_config.motion.m_VideoCardType=0;
|
||||
|
||||
|
||||
g_machine.s_machine_config.x_axis._scale_resolution=0.5;
|
||||
g_machine.s_machine_config.y_axis._scale_resolution=0.5;
|
||||
g_machine.s_machine_config.z_axis._scale_resolution=0.5;
|
||||
|
||||
g_machine.s_machine_config.x_axis._neg_working_limit=0;
|
||||
g_machine.s_machine_config.x_axis._pos_working_limit=200;
|
||||
g_machine.s_machine_config.y_axis._neg_working_limit=0;
|
||||
g_machine.s_machine_config.y_axis._pos_working_limit=100;
|
||||
g_machine.s_machine_config.z_axis._neg_working_limit=0;
|
||||
g_machine.s_machine_config.z_axis._pos_working_limit=200;
|
||||
|
||||
g_machine.s_machine_config.motion.m_RotaryCircleDis=7.2;
|
||||
g_machine.s_machine_config.motion.m_RotaryCirclePulse=14400;
|
||||
g_machine.s_machine_config.motion.m_RotaryAxisNO=MACHINE_AXIS_Y;
|
||||
g_machine.s_machine_config.motion.m_RotaryAxisNO=MACHINE_AXIS_NONE;
|
||||
|
||||
|
||||
return SSI_STATUS_MOTION_NORMAL;
|
||||
@@ -2022,6 +2024,7 @@ SSI_STATUS_MOTION CSO7_Proto::Load_SevenOcean_Inifile(CString cso7IniFile)
|
||||
g_machine._motor_pulse_num=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
/*
|
||||
//=====================[WORKTABLE]========================
|
||||
else if(!_stricmp(token, "X_SCALE_RESOLUTION"))
|
||||
{
|
||||
@@ -2113,6 +2116,7 @@ SSI_STATUS_MOTION CSO7_Proto::Load_SevenOcean_Inifile(CString cso7IniFile)
|
||||
g_machine.dRotaryCirclDis=atof(cTemp);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
fclose(hConfigFile);
|
||||
@@ -2302,6 +2306,56 @@ SSI_STATUS_MOTION CSO7_Proto::Save_So7_Config()
|
||||
fprintf(m_pOutFile, "\n");
|
||||
fprintf(m_pOutFile, ";\n");
|
||||
|
||||
|
||||
outBuff="[CUSTOM_MACHINE]";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="X_SCALE_RESOLUTION=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._scale_resolution);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="Y_SCALE_RESOLUTION=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._scale_resolution);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="Z_SCALE_RESOLUTION=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._scale_resolution);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="X_NEG_WORKING_LIMIT=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._neg_working_limit);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="X_POS_WORKING_LIMIT=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._pos_working_limit);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="Y_NEG_WORKING_LIMIT=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._neg_working_limit);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="Y_POS_WORKING_LIMIT=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._pos_working_limit);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="Z_NEG_WORKING_LIMIT=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._neg_working_limit);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="Z_POS_WORKING_LIMIT=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._pos_working_limit);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="ROTARY_AXIS_NUMBER=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_RotaryAxisNO);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="ROTARY_CIR_DIS=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_RotaryCircleDis);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
fprintf(m_pOutFile, ";\n");
|
||||
|
||||
fclose(m_pOutFile);
|
||||
}
|
||||
return SSI_STATUS_MOTION_NORMAL;
|
||||
@@ -2590,54 +2644,6 @@ SSI_STATUS_MOTION CSO7_Proto::Load_So7_Config()
|
||||
g_machine.s_machine_config.motion.m_DebugOutputEnable=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
//==================Motion=============================
|
||||
else if(!_stricmp(token, "X_SCALE_RESOLUTION"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.x_axis._scale_resolution=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "Y_SCALE_RESOLUTION"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.y_axis._scale_resolution=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "Z_SCALE_RESOLUTION"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.z_axis._scale_resolution=atof(cTemp);
|
||||
}
|
||||
}
|
||||
//=================Rotary========================
|
||||
else if (!_stricmp(token,"ROTARY_AXIS_NUMBER"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_RotaryAxisNO=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"ROTARY_CIR_DIS"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_RotaryCircleDis=atof(cTemp);
|
||||
g_machine.s_machine_config.motion.m_RotaryCirclePulse=g_machine.s_machine_config.motion.m_RotaryCircleDis/ROTARY_MMtoScale_RESOLUTION;
|
||||
}
|
||||
}
|
||||
//=================VideoCard========================
|
||||
else if (!_stricmp(token,"SDK3000_SLEEP_COUNT"))
|
||||
{
|
||||
@@ -2703,6 +2709,108 @@ SSI_STATUS_MOTION CSO7_Proto::Load_So7_Config()
|
||||
g_machine.s_machine_config.motion.m_VideoCardType=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
|
||||
//=================Custom machine========================
|
||||
else if(!_stricmp(token, "X_SCALE_RESOLUTION"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.x_axis._scale_resolution=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "Y_SCALE_RESOLUTION"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.y_axis._scale_resolution=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "Z_SCALE_RESOLUTION"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.z_axis._scale_resolution=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "X_NEG_WORKING_LIMIT"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.x_axis._neg_working_limit=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "X_POS_WORKING_LIMIT"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.x_axis._pos_working_limit=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "Y_NEG_WORKING_LIMIT"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.y_axis._neg_working_limit=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "Y_POS_WORKING_LIMIT"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.y_axis._pos_working_limit=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "Z_NEG_WORKING_LIMIT"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.z_axis._neg_working_limit=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token, "Z_POS_WORKING_LIMIT"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.z_axis._pos_working_limit=atof(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"ROTARY_AXIS_NUMBER"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_RotaryAxisNO=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"ROTARY_CIR_DIS"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_RotaryCircleDis=atof(cTemp);
|
||||
g_machine.s_machine_config.motion.m_RotaryCirclePulse=g_machine.s_machine_config.motion.m_RotaryCircleDis/ROTARY_MMtoScale_RESOLUTION;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(hConfigFile);
|
||||
@@ -3734,6 +3842,148 @@ SSI_STATUS_MOTION CSO7_Proto::_get_xyz_index(long & lX, long & lY, long & lZ)
|
||||
|
||||
return SSI_STATUS_MOTION_NORMAL;
|
||||
};
|
||||
SSI_STATUS_MOTION CSO7_Proto::so7_motion_jog(EMACHINE_AXIS cAxis,char cSpeedGear)
|
||||
{
|
||||
if (abs(cSpeedGear)>4)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=4;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-4;
|
||||
}
|
||||
}
|
||||
if (abs(cSpeedGear)<1)
|
||||
{
|
||||
cSpeedGear=1;
|
||||
}
|
||||
switch (cAxis)
|
||||
{
|
||||
case MACHINE_AXIS_X:
|
||||
{
|
||||
if (cSpeedGear==4)
|
||||
{
|
||||
double dXStart(0.0), dYStart(0.0), dZStart(0.0);
|
||||
so7_motion_get_position_xyz(dXStart, dYStart, dZStart);
|
||||
return so7_motion_set_position_xyz(g_machine.s_machine_config.x_axis._pos_working_limit,dYStart,dZStart,false);
|
||||
}
|
||||
else if (cSpeedGear==-4)
|
||||
{
|
||||
double dXStart(0.0), dYStart(0.0), dZStart(0.0);
|
||||
so7_motion_get_position_xyz(dXStart, dYStart, dZStart);
|
||||
return so7_motion_set_position_xyz(g_machine.s_machine_config.x_axis._neg_working_limit,dYStart,dZStart,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return _send_cmd_SO7_CMD_MOVE_X(cSpeedGear);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MACHINE_AXIS_Y:
|
||||
{
|
||||
if (cSpeedGear==4)
|
||||
{
|
||||
double dXStart(0.0), dYStart(0.0), dZStart(0.0);
|
||||
so7_motion_get_position_xyz(dXStart, dYStart, dZStart);
|
||||
return so7_motion_set_position_xyz(dXStart,g_machine.s_machine_config.y_axis._pos_working_limit,dZStart,false);
|
||||
}
|
||||
else if (cSpeedGear==-4)
|
||||
{
|
||||
double dXStart(0.0), dYStart(0.0), dZStart(0.0);
|
||||
so7_motion_get_position_xyz(dXStart, dYStart, dZStart);
|
||||
return so7_motion_set_position_xyz(dXStart,g_machine.s_machine_config.y_axis._neg_working_limit,dZStart,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return _send_cmd_SO7_CMD_MOVE_Y(cSpeedGear);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MACHINE_AXIS_Z:
|
||||
{
|
||||
if (cSpeedGear==4)
|
||||
{
|
||||
double dXStart(0.0), dYStart(0.0), dZStart(0.0);
|
||||
so7_motion_get_position_xyz(dXStart, dYStart, dZStart);
|
||||
return so7_motion_set_position_xyz(dXStart,dYStart,g_machine.s_machine_config.z_axis._pos_working_limit,false);
|
||||
}
|
||||
else if (cSpeedGear==-4)
|
||||
{
|
||||
double dXStart(0.0), dYStart(0.0), dZStart(0.0);
|
||||
so7_motion_get_position_xyz(dXStart, dYStart, dZStart);
|
||||
return so7_motion_set_position_xyz(dXStart,dYStart,g_machine.s_machine_config.z_axis._neg_working_limit,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return _send_cmd_SO7_CMD_MOVE_Z(cSpeedGear);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MACHINE_AXIS_ZOOM:
|
||||
{
|
||||
if (abs(cSpeedGear)==4)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=5;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-5;
|
||||
}
|
||||
}
|
||||
else if (abs(cSpeedGear)==3)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=5;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-5;
|
||||
}
|
||||
}
|
||||
else if (abs(cSpeedGear)==2)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-1;
|
||||
}
|
||||
}
|
||||
else if (abs(cSpeedGear)==1)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-2;
|
||||
}
|
||||
}
|
||||
return _send_cmd_SO7_CMD_MOVE_ZM(cSpeedGear);
|
||||
break;
|
||||
}
|
||||
case MACHINE_AXIS_R:
|
||||
{
|
||||
return so7_motion_move_R(cSpeedGear);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return SSI_STATUS_MOTION_INVALID_PARAMETERS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return SSI_STATUS_MOTION_NORMAL;
|
||||
}
|
||||
|
||||
//==================================================================
|
||||
SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_position_xyz(double & dX, double & dY, double & dZ)
|
||||
{
|
||||
@@ -3776,11 +4026,44 @@ SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_position_xyz(double dX, double dY,
|
||||
SO7AXISMOVE Z;
|
||||
|
||||
X.dFromMM = dXStart;
|
||||
X.dToMM = dX;
|
||||
if (dX<g_machine.s_machine_config.x_axis._neg_working_limit)
|
||||
{
|
||||
X.dToMM=g_machine.s_machine_config.x_axis._neg_working_limit;
|
||||
}
|
||||
else if (dX>g_machine.s_machine_config.x_axis._pos_working_limit)
|
||||
{
|
||||
X.dToMM=g_machine.s_machine_config.x_axis._pos_working_limit;
|
||||
}
|
||||
else
|
||||
{
|
||||
X.dToMM = dX;
|
||||
}
|
||||
Y.dFromMM = dYStart;
|
||||
Y.dToMM = dY;
|
||||
if (dY<g_machine.s_machine_config.y_axis._neg_working_limit)
|
||||
{
|
||||
Y.dToMM=g_machine.s_machine_config.y_axis._neg_working_limit;
|
||||
}
|
||||
else if (dY>g_machine.s_machine_config.y_axis._pos_working_limit)
|
||||
{
|
||||
Y.dToMM=g_machine.s_machine_config.y_axis._pos_working_limit;
|
||||
}
|
||||
else
|
||||
{
|
||||
Y.dToMM = dY;
|
||||
}
|
||||
Z.dFromMM = dZStart;
|
||||
Z.dToMM = dZ;
|
||||
if (dZ<g_machine.s_machine_config.z_axis._neg_working_limit)
|
||||
{
|
||||
Z.dToMM=g_machine.s_machine_config.z_axis._neg_working_limit;
|
||||
}
|
||||
else if (dZ>g_machine.s_machine_config.z_axis._pos_working_limit)
|
||||
{
|
||||
Z.dToMM=g_machine.s_machine_config.z_axis._pos_working_limit;
|
||||
}
|
||||
else
|
||||
{
|
||||
Z.dToMM = dZ;
|
||||
}
|
||||
|
||||
X.from = MMtoScale(dXStart, g_machine.s_machine_config.x_axis._scale_resolution);
|
||||
X.to = MMtoScale(dX, g_machine.s_machine_config.x_axis._scale_resolution);
|
||||
|
||||
@@ -453,7 +453,8 @@ public:
|
||||
SSI_STATUS_MOTION so7_motion_reset_controller_parameter();
|
||||
|
||||
SSI_STATUS_MOTION _get_xyz_index(long & lX, long & lY, long & lZ);
|
||||
SSI_STATUS_MOTION so7_motion_get_position_xyz(double & dX, double & dY, double & dZ);
|
||||
SSI_STATUS_MOTION so7_motion_jog(EMACHINE_AXIS cAxis,char cSpeedGear);
|
||||
SSI_STATUS_MOTION so7_motion_get_position_xyz(double & dX, double & dY, double & dZ);
|
||||
SSI_STATUS_MOTION so7_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait);
|
||||
SSI_STATUS_MOTION so7_Motion_XYZ_IsMotionFinished(bool &bFinished);
|
||||
BOOL IsMotionFinishedManual(BOOL _BResetCnts=FALSE);
|
||||
|
||||
+1
-92
@@ -215,99 +215,8 @@ EXP_IMP SSI_STATUS_MOTION Motion_Jog(EMACHINE_AXIS cAxis,char cSpeedGear)
|
||||
{
|
||||
if (m_pSO7_Proto)
|
||||
{
|
||||
if (abs(cSpeedGear)>4)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=4;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-4;
|
||||
}
|
||||
}
|
||||
if (abs(cSpeedGear)<1)
|
||||
{
|
||||
cSpeedGear=1;
|
||||
}
|
||||
ActiveAxis=cAxis;
|
||||
switch (cAxis)
|
||||
{
|
||||
case MACHINE_AXIS_X:
|
||||
{
|
||||
return m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_X(cSpeedGear);
|
||||
break;
|
||||
}
|
||||
case MACHINE_AXIS_Y:
|
||||
{
|
||||
return m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_Y(cSpeedGear);
|
||||
break;
|
||||
}
|
||||
case MACHINE_AXIS_Z:
|
||||
{
|
||||
return m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_Z(cSpeedGear);
|
||||
break;
|
||||
}
|
||||
case MACHINE_AXIS_ZOOM:
|
||||
{
|
||||
if (abs(cSpeedGear)==4)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=5;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-5;
|
||||
}
|
||||
}
|
||||
else if (abs(cSpeedGear)==3)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=5;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-5;
|
||||
}
|
||||
}
|
||||
else if (abs(cSpeedGear)==2)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-1;
|
||||
}
|
||||
}
|
||||
else if (abs(cSpeedGear)==1)
|
||||
{
|
||||
if (cSpeedGear>0)
|
||||
{
|
||||
cSpeedGear=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
cSpeedGear=-2;
|
||||
}
|
||||
}
|
||||
return m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_ZM(cSpeedGear);
|
||||
break;
|
||||
}
|
||||
case MACHINE_AXIS_R:
|
||||
{
|
||||
return m_pSO7_Proto->so7_motion_move_R(cSpeedGear);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return SSI_STATUS_MOTION_INVALID_PARAMETERS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return m_pSO7_Proto->so7_motion_jog(cAxis,cSpeedGear);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -376,6 +376,7 @@ void CSO7_Send_Parameter::OnBnClickedButtonSave()
|
||||
|
||||
if( fdlg.DoModal()==IDOK)
|
||||
{
|
||||
m_pSO7_Proto->Save_So7_Config();
|
||||
path_and_fileName=fdlg.GetPathName();
|
||||
ChangeParameterOnEdit();
|
||||
switch(fdlg.m_ofn.nFilterIndex)
|
||||
|
||||
@@ -942,6 +942,8 @@ void CSO7_UtilDlg::OnEnKillfocusEditXScaleCoefficient()
|
||||
const char* cTempValue=T2A(m_cs_XScaleCoeff);
|
||||
|
||||
m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution = atof(cTempValue);
|
||||
m_pSO7_Proto->Save_So7_Config();
|
||||
|
||||
}
|
||||
void CSO7_UtilDlg::OnEnKillfocusEditYScaleCoefficient()
|
||||
{
|
||||
@@ -951,6 +953,8 @@ void CSO7_UtilDlg::OnEnKillfocusEditYScaleCoefficient()
|
||||
const char* cTempValue=T2A(m_cs_YScaleCoeff);
|
||||
|
||||
m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution = atof(cTempValue);
|
||||
m_pSO7_Proto->Save_So7_Config();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -962,6 +966,7 @@ void CSO7_UtilDlg::OnEnKillfocusEditZScaleCoefficient()
|
||||
const char* cTempValue=T2A(m_cs_ZScaleCoeff);
|
||||
|
||||
m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution = atof(cTempValue);
|
||||
m_pSO7_Proto->Save_So7_Config();
|
||||
}
|
||||
|
||||
void CSO7_UtilDlg::OnBnClickedButtonMotionParameter()
|
||||
|
||||
@@ -61,8 +61,8 @@ BOOL CSetSo7MotionConfig::OnInitDialog()
|
||||
}
|
||||
UpdateLabelName();
|
||||
UpdateDataValue();
|
||||
m_ConfigList.SetEditableItemRange(0,23,2,2);
|
||||
m_ConfigList.SetColorStyleItemRange(0,25,0,3);
|
||||
m_ConfigList.SetEditableItemRange(0,36,2,2);
|
||||
m_ConfigList.SetColorStyleItemRange(0,36,0,3);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -226,6 +226,72 @@ void CSetSo7MotionConfig::UpdateLabelName()
|
||||
cStr=L"视频卡类型;保留项;默认值:0";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
|
||||
|
||||
cStr=L"X_SCALE_RESOLUTION";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"X轴光栅尺分辨率;单位:um;默认值:0.5";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
|
||||
cStr=L"Y_SCALE_RESOLUTION";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"Y轴光栅尺分辨率;单位:um;默认值:0.5";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
|
||||
cStr=L"Z_SCALE_RESOLUTION";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"Z轴光栅尺分辨率;单位:um;默认值:0.5";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
|
||||
cStr=L"X_NEG_WORKING_LIMIT";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"X轴负向限位位置;单位:mm;默认值:0";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
cStr=L"X_POS_WORKING_LIMIT";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"X轴正向限位位置;单位:mm;默认值:200";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
|
||||
cStr=L"Y_NEG_WORKING_LIMIT";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"Y轴负向限位位置;单位:mm;默认值:0";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
cStr=L"Y_POS_WORKING_LIMIT";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"Y轴正向限位位置;单位:mm;默认值:100";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
|
||||
cStr=L"Z_NEG_WORKING_LIMIT";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"Z轴负向限位位置;单位:mm;默认值:0";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
cStr=L"Z_POS_WORKING_LIMIT";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"Z轴正向限位位置;单位:mm;默认值:200";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
|
||||
cStr=L"ROTARY_AXIS_NUMBER";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"转台轴编号;0:禁用,1:X轴,2:Y轴,3:Z轴;默认值:0";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
|
||||
cStr=L"ROTARY_CIR_DIS";
|
||||
m_ConfigList.SetItemText(iRow,iCol,cStr);
|
||||
cStr=L"转盘一圈的位移量;单位:mm;默认值:7.2";
|
||||
m_ConfigList.SetItemText(iRow,iCol+2,cStr);
|
||||
iRow++;
|
||||
|
||||
|
||||
}
|
||||
void CSetSo7MotionConfig::UpdateDataValue()
|
||||
{
|
||||
@@ -287,6 +353,31 @@ void CSetSo7MotionConfig::UpdateDataValue()
|
||||
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);
|
||||
|
||||
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.x_axis._neg_working_limit);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.x_axis._pos_working_limit);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.y_axis._neg_working_limit);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.y_axis._pos_working_limit);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.z_axis._neg_working_limit);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.z_axis._pos_working_limit);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%d"),m_pSO7_Proto->g_machine.s_machine_config.motion.m_RotaryAxisNO);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
cStr.Format(_T("%.4f"),m_pSO7_Proto->g_machine.s_machine_config.motion.m_RotaryCircleDis);
|
||||
m_ConfigList.SetItemText(iRow++,iCol,cStr);
|
||||
|
||||
}
|
||||
void CSetSo7MotionConfig::SaveDataValue()
|
||||
{
|
||||
@@ -394,6 +485,52 @@ void CSetSo7MotionConfig::SaveDataValue()
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.motion.m_SV4000E_DenoisePara[3]=atoi(cTemp);
|
||||
iRow++;
|
||||
|
||||
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution=atof(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution=atof(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution=atof(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.x_axis._neg_working_limit=atof(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.x_axis._pos_working_limit=atof(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.y_axis._neg_working_limit=atof(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.y_axis._pos_working_limit=atof(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.z_axis._neg_working_limit=atof(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.z_axis._pos_working_limit=atof(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.motion.m_RotaryAxisNO=atoi(cTemp);
|
||||
iRow++;
|
||||
cStr=m_ConfigList.GetItemText(iRow,iCol);
|
||||
cTemp=T2A(cStr);
|
||||
m_pSO7_Proto->g_machine.s_machine_config.motion.m_RotaryCircleDis=atof(cTemp);
|
||||
iRow++;
|
||||
}
|
||||
void CSetSo7MotionConfig::OnBnClickedButtonSo7MotionConfigOk()
|
||||
{
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user