Skip to content

Commit

Permalink
sai: Fix #1279
Browse files Browse the repository at this point in the history
  • Loading branch information
andypugh committed Oct 3, 2023
1 parent 946b421 commit b27646d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/emc/sai/driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,21 @@ int main (int argc, char ** argv)
exit(1);
}
}
_sai._external_length_units = 0.03937007874016;
if (inifile!= 0) {
const char *inistring;
IniFile ini;
// open it
if (ini.Open(inifile) == false) {
fprintf(stderr, "could not open supplied INI file %s\n", inifile);
exit(1);
}

if (NULL != (inistring = ini.Find("LINEAR_UNITS", "TRAJ"))) {
if (!strcmp(inistring, "mm")) {
_sai._external_length_units = 1.0;
}
}
setenv("INI_FILE_NAME",inifile,1);
} else
unsetenv("INI_FILE_NAME");
Expand Down
4 changes: 2 additions & 2 deletions src/emc/sai/saicanon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ int GET_EXTERNAL_FEED_OVERRIDE_ENABLE() {return fo_enable;}
double GET_EXTERNAL_MOTION_CONTROL_TOLERANCE() { return _sai.motion_tolerance;}
double GET_EXTERNAL_MOTION_CONTROL_NAIVECAM_TOLERANCE()
{ return _sai.naivecam_tolerance; }
double GET_EXTERNAL_LENGTH_UNITS() {return 0.03937007874016;}
double GET_EXTERNAL_LENGTH_UNITS() {return _sai._external_length_units;}
int GET_EXTERNAL_FEED_HOLD_ENABLE() {return 1;}
int GET_EXTERNAL_AXIS_MASK() {return 0x3f;} // XYZABC machine
double GET_EXTERNAL_ANGLE_UNITS() {return 1.0;}
Expand Down Expand Up @@ -770,7 +770,7 @@ extern CANON_MOTION_MODE GET_EXTERNAL_MOTION_CONTROL_MODE()

extern void SET_PARAMETER_FILE_NAME(const char *name)
{
strncpy(_parameter_file_name, name, PARAMETER_FILE_NAME_LENGTH);
strncpy(_parameter_file_name, name, PARAMETER_FILE_NAME_LENGTH - 1);
}

void GET_EXTERNAL_PARAMETER_FILE_NAME(
Expand Down
1 change: 1 addition & 0 deletions src/emc/sai/saicanon.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct StandaloneInterpInternals
int _feed_mode;
double _feed_rate;
int _flood;
double _external_length_units;
double _length_unit_factor;
CANON_UNITS _length_unit_type;
int _line_number;
Expand Down

0 comments on commit b27646d

Please sign in to comment.