Overview
The StixCtlGenerateState class is a helper class for code generation with StixCtlGenerate. This class holds the last commanded positions, feed, speed, and so forth. The format class uses these values to avoid issuing duplicate moves to the same coordinates.
addMoveComment()
void addMoveComment (const char * f);
The addMoveComment() function appends an already-formatted comment to a string variable. These comments are returned by the getMoveComment() function and prepended to the results of the next formatted MOVE event. The clearMoveComment() function empties the string.
addMovePrefix()
void addMovePrefix (const char * f);
The addMovePrefix() function appends some codes to a string variable. These codes are returned by the getMovePrefix() function and prepended to the next move command. For example, a tool change event processing may add a "G43 H..." prefix to set tool offsets, which typically must be issued with the next G1 or G0 command. The clearMovePrefix() function empties the string.
clearCoolant()
void clearCoolant();
The clearCoolant() function sets all coolant-related variables to false. This includes getCoolant(), getCoolantMist(), and getCoolantThru()
clearFeed()
void clearFeed();
The clearFeed() function sets the getFeed() value to ROSE_NULL_REAL.
clearMoveComment()
void clearMoveComment();
The clearMoveComment() function sets the string returned by getMoveComment() to a null string.
clearMovePrefix()
void clearMovePrefix();
The clearMovePrefix() function sets the string returned by getMovePrefix() to a null string.
clearMovemode()
void clearMovemode();
The clearMovemode() function sets the getMovemode() variable to -1.
clearPosition()
void clearPosition();
The clearPosition() function sets all of the tool position and angle variables getX/Y/Z/I/J/K/A/B/Cpos() to ROSE_NULL_REAL.
clearProgramStats()
void clearProgramStats();
The clearProgramStats() function sets the variables initialized by setProgramStats() to null or false. This includes getProgramHas5axis() and getProgramHasProbes().
clearRefpoint()
void clearRefpoint();
The clearRefpoint() function clears any information about cutter contact direction and sets the reference point back to center, so isRefpointCenter() is true.
clearSpindle()
void clearSpindle();
The clearSpindle() function sets the getSpindle() value to ROSE_NULL_REAL.
getA/B/Cpos()
double getApos(); double getBpos(); double getCpos();
The getA/B/Cpos() functions return the last commanded value for the rotational axes. These are only set if the output style explicitly commands these axes. Some output styles tilt the tool by commanding an I/J/K direction vector, in which case these A/B/C values would remain null. These can be changed by the setA/B/Cpos() functions.
getCoolant()
int getCoolant();
The getCoolant() function returns true if the last commanded state of flood coolant was on. The setCoolant() function changes this value.
getCoolantMist()
int getCoolantMist();
The getCoolantMist() function returns true if the last commanded state of mist coolant was on. The setCoolantMist() function changes this value.
getCoolantThru()
int getCoolantThru();
The getCoolantThru() function returns true if the last commanded state of through-spindle coolant was on. The setCoolantThru() function changes this value.
getFeed()
double getFeed();
The getFeed() function returns the last commanded numeric feedrate. The setFeed() function changes this value. This is not affected by rapid moves, but the getMovemode() function can be used to test whether the last commanded move was rapid motion.
getI/J/Kpos()
double getIpos(); double getJpos(); double getKpos(); RoseDirection getIJKpos();
The getI/J/Kpos() functions return the last commanded value for the tool axis direction vector. The values may be ROSE_NULL_REAL if the axis has not yet been commanded. This is always set when the tool axis changes, even if the output styles commands the A/B/C axes. There are functions for each individual direction component and a group function that returns all of the components as a direction object. These can be changed by the setI/J/Kpos() functions.
getLastBlocknum()
int getLastBlocknum();
The getLastBlocknum() function returns the last assigned block number. To increment or change the count, use getNextBlocknum() or setBlocknum()
getMoveComment()
const char * getMoveComment();
The getMoveComment() function returns a string containing already-formatted comments that should be prepended to the results of the next formatted MOVE event. This is typically used for trace comments. See addMoveComment() for more discussion.
getMovePrefix()
const char * getMovePrefix();
The getMovePrefix() function returns a string containing codes that should be prepended to the next move command. This is typically used for setting tool offsets. See addMovePrefix() for more discussion.
getMovemode()
int getMovemode();
The getMovemode() function returns a numeric value for the last commanded modal move state. There are many modal states on CNC controls, but this value is used to avoid duplicating G0/G1 codes when issuing a series of moves. This value is -1 when unknown, zero when in "G0" rapid motion, one in "G1" motion, 2 in "G2" circular interpolation, etc. The setMovemode() function changes this value.
getNextBlocknum()
int getNextBlocknum();
The getNextBlocknum() function increments the block number counter and returns the new value. The getLastBlocknum() function returns the value without incrementing it and setBlocknum() assigns a new value.
getNextProbeIndex()
int getNextProbeIndex();
The getNextProbeIndex() function increments the number of probing operations visited so far and returns the new value. The getProbeIndex() function returns the value without incrementing and setProbeIndex() assigns a new value.
getOtherObj()
RoseObject * getOtherObj(const char * nm);
The getOtherObj() function returns a value from a dictionary of STEP objects. This dictionary may be used by some formatting functions to keep information for future use. The setOtherObj() assigns a value to the dictionary.
getProbeCount()
int getProbeCount();
The getProbeCount() function returns the number of probing operations found in the program. This does not count any disabled operations that would not be visited by the cursor. This value is computed by the setProgramStats() function.
getProbeIndex()
int getProbeIndex();
The getProbeIndex() function returns the number of probing operations visited so far. It is incremented by the getNextProbeIndex() function and can be given a new value by the setProbeIndex() function.
getProgramHas5axis()
int getProgramHas5axis();
The getProgramHas5axis() function returns true if any of the toolpaths in the program include a tool axis curve. This does not count any disabled operations that would not be visited by the cursor. This value is computed by the setProgramStats() function.
getProgramHasProbes()
int getProgramHasProbes()
The getProgramHasProbes() function returns true if the program includes any probing operations. This does not count any disabled operations that would not be visited by the cursor. This value is computed by the setProgramStats() function. This is equivalent to testing whether getProbeCount() is greater than zero.
getSpindle()
double getSpindle();
The getSpindle() function returns the last commanded spindle speed. The value is zero if the spindle was off, positive if the direction was counter clockwise, or negative if it is clockwise. The setSpindle() function will change this value.
getX/Y/Zpos()
double getXpos(); double getYpos(); double getZpos(); RosePoint getXYZpos();
The getXpos() functions return the last commanded value for the tool position. The values may be ROSE_NULL_REAL if the position has not yet been commanded. There are functions for each individual axis and a group function that returns all of the components as a point object. These can be changed by the setX/Y/Zpos() functions.
isChangedIJKpos()
int isChangedIJKpos (const RoseDirection &pos);
The isChangedIJKpos() function compares the input direction with the last commanded tool axis direction and returns true if any of the components have changed. This does an epsilon comparison of the values using the default ROSE_EPSILON value. This is almost alwasys a stricter comparison than the isFormattedIJK() comparison of the format class.
isChangedIJKposAssume3axis()
int isChangedIJKposAssume3axis (const RoseDirection &pos)
The isChangedIJKposAssume3axis() function returns true if any of the direction components have changed, but assumes that if the program does not have any 5-axis moves and the getIJKpos() values are null, that they are equivalent to (0,0,1). As with isChangedIJKpos(), this does an epsilon comparison of the values rather than the formatted comparison.
isChangedXYZpos()
int isChangedXYZpos (const RosePoint &xyzpos)
The isChangedXYZpos() function returns true if any of the position components have changed. This does an epsilon comparison of the values using the default ROSE_EPSILON value. This is almost alwasys a stricter comparison than the isFormattedXYZ() comparison of the format class.
isRefpointCenter()
int isRefpointCenter();
The isRefpointCenter() function returns true if move commands are in reference to the tool center point. This is the default.
isRefpointContact()
int isRefpointContact()
The isRefpointContact() function returns true if move commands are in reference to the tool contact point. STEP-NC process data can provide a range of surface normals for cutter contact paths, but traditionally machines are only able to handle contact on the left or right side of the tool. Change this value by calling setRefpointCenter() or setRefpointContact().
isRefpointLeft()
int isRefpointLeft();
The isRefpointLeft() function returns true if in contact mode and setRefpointLeft() has been called.
isRefpointRight()
int isRefpointRight();
The isRefpointRight() function returns true if in contact mode and setRefpointRight() has been called.
isUnknownIJKpos()
int isUnknownIJKpos();
The isUnknownIJKpos() function returns true if all of the components of the last commanded tool axis direction are null.
isUnknownXYZpos()
int isUnknownXYZpos();
The isUnknownXYZpos() function returns true if all of the components of the last commanded tool position are null.
reset()
void reset();
The reset() function clears all variables and returns them to the default state.
setA/B/Cpos()
void setApos (double s); void setBpos (double s); void setCpos (double s);
The setA/B/Cpos() functions set the last commanded value for the rotational axes. See getA/B/Cpos() for more discussion.
setBlocknum()
void setBlocknum(int num);
The setBlocknum() function sets the current number used when prepending a "N" prefix to lines. See getLastBlocknum() for more discussion.
setCoolant()
void setCoolant (int yn);
The setCoolant() function sets the last commanded on/off state for flood coolant to the given value. See getCoolant() for more discussion.
setCoolantMist()
void setCoolantMist (int yn);
The setCoolantMist() function sets the last commanded on/off state for mist coolant to the given value. See getCoolantMist() for more discussion.
setCoolantThru()
void setCoolantThru (int yn);
The setCoolantThru() function sets the last commanded on/off state for through-spindle coolant to the given value. See getCoolantThru() for more discussion.
setFeed()
void setFeed (double s);
The setFeed() function sets the last commanded feedrate to the given value. See getFeed() for more discussion.
setI/J/Kpos()
void setIpos (double s); void setJpos (double s); void setKpos (double s); void setIJKpos (const RoseDirection &v);
The setI/J/Kpos() functions set the last commanded components for the tool axis direction vector. There are functions for each individual component and a group function that sets all of them from a direction object. See getIJKpos for more discussion.
setMovemode()
void setMovemode (int m);
The setMovemode() function sets a numeric value for the last commanded modal move state - zero for G0, one for G1, etc. This value is used to avoid duplicating G0/G1 codes when issuing a series of moves. See getMovemode() for more discussion.
setOtherObj()
void setOtherObj( const char * nm, RoseObject * obj );
The setOtherObj() function adds a value to a dictionary of STEP objects. This dictionary may be used by some formatting functions to keep information for future use. See getOtherObj() for more discussion.
setProbeCount()
void setProbeCount(int d);
The setProbeCount() function sets the count of probing operations found in the program. Normally, this value is computed and set by the setProgramStats() function. See getProbeCount() for more discussion.
setProbeIndex()
void setProbeIndex(int d);
The setProbeIndex() function sets the number of probing operations visited so far. It can be incremented by the nextProbeIndex() function. See getProbeIndex() for more discussion.
setProgramHas5axis()
void setProgramHas5axis(int yn);
The setProgramHas5axis() function sets a flag indicating whether any five axis moves are found in the program. Normally, this value is computed and set by the setProgramStats() function. See getProgramHas5axis() for more discussion.
setProgramStats()
void setProgramStats(StixCtlCursor &ctl);
The setProgramStats() function scans the process being traversed by a cursor and sets some variables based on what the process holds. In particulary, the getProgramHas5axis() and getProbeCount() variables are set.
The input cursor is not changed in any way.
setRefpointCenter()
void setRefpointCenter()
The setRefpointCenter() function sets the isRefpointCenter() flag to true and isRefpointContact() to false, indicating that commands are in reference to the tool center point.
setRefpointContact()
void setRefpointContact()
The setRefpointContact() function sets the isRefpointCenter() false to true and isRefpointContact() to true, indicating that commands are in reference to the cutter contact point. A call to this function is expected to be followed by a call to setRefpointLeft() or setRefpointRight().
setRefpointLeft()
void setRefpointLeft();
The setRefpointLeft() function sets the isRefpointLeft() flag to true and isRefpointRight() to false.
setRefpointRight()
void setRefpointRight();
The setRefpointRight() function sets the isRefpointLeft() flag to false and isRefpointRight() to true.
setSpindle()
void setSpindle (double s)
The setSpindle() function sets the last commanded spindle speed. The value is zero if the spindle was off, positive if the direction was counter clockwise, or negative if it is clockwise. See getSpindle() for more discussion.
setX/Y/Zpos()
void setXpos (double s); void setYpos (double s); void setZpos (double s); void setXYZpos (const RosePoint &v);
The setX/Y/Zpos() functions set the last commanded value for the tool position. There are functions for each individual axis and a group function that sets all of the components from a point object. See getX/Y/Zpos() for more discussion.