Class NcLine
Represents a line in the NC program with its associated data and operations.
public class NcLine : ISourceCommand, IFileLine, IFileLineIndex, IGetIndexedFileLine, IGetFileLineIndex, IGetSourceCommand
- Inheritance
-
NcLine
- Implements
- Inherited Members
- Extension Methods
Constructors
NcLine(NcEnv, IndexedFileLine, NcLine, out NcNoteCache, IMessageKit)
Ctor from the reference NcLine.
public NcLine(NcEnv ncEnv, IndexedFileLine fileLine, NcLine preNcLine, out NcNoteCache ncLineCache, IMessageKit messageHost)
Parameters
ncEnv
NcEnvNC environment
fileLine
IndexedFileLinefile line
preNcLine
NcLinereference NcLine that this NcLine copy from. If previous NcLine is not null, apply previous NcLine.
ncLineCache
NcNoteCacheOutput NC note cache
messageHost
IMessageKitMessage host for warnings
NcLine(NcEnv, IMessageKit)
Ctor for initial state.
public NcLine(NcEnv ncEnv, IMessageKit messageHost)
Parameters
ncEnv
NcEnvmessageHost
IMessageKit
Properties
ArcNcArg
NC arguments for arc commands.
public ArcNcArg ArcNcArg { get; set; }
Property Value
CoordinateInterpolationMode
Gets the current coordinate interpolation mode (Cartesian or Polar).
public CoordinateInterpolationMode CoordinateInterpolationMode { get; }
Property Value
F
F. Feedrate on NC code. Note that this may not be the working feedrate. Some NC codes like G00 and G28 doesnt use F code.
public double F { get; set; }
Property Value
Remarks
According to Fanuc manual, the default F is zero.
Feedrate_mmdmin
Feedrate on NC code in mm/min. See F.
public double Feedrate_mmdmin { get; set; }
Property Value
Feedrate_mmds
Feedrate on NC code in mm/sec. See F.
public double Feedrate_mmds { get; set; }
Property Value
FileIndex
File Index. Start on 0.
public int FileIndex { get; }
Property Value
FileNo
[Present("File Number", "FileNo", PhysicsUnit.None, "G")]
public int FileNo { get; }
Property Value
FilePath
File path.
[Present("File", "File", PhysicsUnit.None, "G")]
public string FilePath { get; }
Property Value
FlagsText
Gets a string representation of the active NC flags for this line.
public string FlagsText { get; }
Property Value
G28Arg
Arguments for G28 commands.
public G28Arg G28Arg { get; set; }
Property Value
G52_Xyz
Local coordinate system translation.
public Vec3d G52_Xyz { get; set; }
Property Value
G54SeriesCoordinateNum1000
Faunc Group14 value. Note that Heidenhain Datum shift is set by DatumTableId.
public int G54SeriesCoordinateNum1000 { get; set; }
Property Value
Group07NcArg
Arguments for Group07 NC commands (tool radius compensation).
public Group07NcArg Group07NcArg { get; set; }
Property Value
Group07_D
Radius compensation ID. Note that in Siemens controller, each tool ID has several D entry.
public int Group07_D { get; set; }
Property Value
Group08_H
Height compensation ID. For Siemens Traori, the value is Tool ID. For Heidenhain, the value is Tool ID.
public int Group08_H { get; set; }
Property Value
Group09NcArg
NC Argument of NC Group09.
public Group09NcArg Group09NcArg { get; set; }
Property Value
HeidenhainBlockCacheArg
Heidenhain block cache arguments for various Heidenhain commands.
public IHeidenhainBlockCacheArg HeidenhainBlockCacheArg { get; set; }
Property Value
HeidenhainCycleDef247Q339
DATUM SETTING DATUM Number.
public int HeidenhainCycleDef247Q339 { get; set; }
Property Value
HeidenhainCycleDef7Arg
Arguments for Heidenhain Cycle Definition 7 (datum shift).
public HeidenhainCycleDef7Arg HeidenhainCycleDef7Arg { get; set; }
Property Value
HeidenhainM140MB
HeidenhainM140(Retract the tool) MB value. MB is the retraction height. double.positiveInf is [MB MAX]. One shot command.
public double HeidenhainM140MB { get; set; }
Property Value
HeidenhainQMacroMap
Dictionary mapping Q macro numbers to their string values for Heidenhain controllers.
public Dictionary<int, string> HeidenhainQMacroMap { get; set; }
Property Value
HeidenhainToolAxisDir
Direction of the tool axis for Heidenhain controllers.
public int HeidenhainToolAxisDir { get; set; }
Property Value
IndexedFileLine
The file line information associated with this NC line.
public IndexedFileLine IndexedFileLine { get; }
Property Value
IsAbsolutePositioning
Gets a value indicating whether absolute positioning (G90) is active.
public bool IsAbsolutePositioning { get; }
Property Value
IsHeightCompensationEnabled
Gets a value indicating whether height compensation is enabled.
public bool IsHeightCompensationEnabled { get; }
Property Value
IsOnArcCommand
Gets a value indicating whether an arc command (G02 or G03) is active.
public bool IsOnArcCommand { get; }
Property Value
IsPathPrepared
Gets a value indicating whether the path is prepared (no radius compensation).
public bool IsPathPrepared { get; }
Property Value
IsRadiusCompensationEnabled
Gets a value indicating whether radius compensation is enabled.
public bool IsRadiusCompensationEnabled { get; }
Property Value
IsToolCenterPointManagementEnabled
Gets a value indicating whether tool center point management is enabled.
public bool IsToolCenterPointManagementEnabled { get; }
Property Value
Line
The line.
[Present("Line", "Line", PhysicsUnit.None, "G")]
public string Line { get; }
Property Value
LineIndex
Line Index. Start on 0.
public int LineIndex { get; }
Property Value
LineNo
[Present("Line Number", "LineNo", PhysicsUnit.None, "G")]
public int LineNo { get; }
Property Value
McAbc_deg
public Vec3d McAbc_deg { get; set; }
Property Value
McAbc_rad
Machine coordinates in ABC format (radians).
public Vec3d McAbc_rad { get; }
Property Value
McXyz
Gets or sets the machine coordinate XYZ values.
public Vec3d McXyz { get; }
Property Value
McXyzabc
Machine coordinate ( with side radius compensation if existed). Point is XYZ. the unit is mm. Normal is ABC. the unit is radian.
public DVec3d McXyzabc { get; }
Property Value
NcFlagBitArray
Internal Used.
public BitArray NcFlagBitArray { get; }
Property Value
PausingNcArg
public PausingNcArg PausingNcArg { get; set; }
Property Value
Remarks
Since this is base on OneShot Flag, so here has no copy ctor.
PolarEntry
Data structure for polar coordinates entry.
public PolarEntry PolarEntry { get; set; }
Property Value
PreparationT
Tool ID for preparation.
public int PreparationT { get; set; }
Property Value
ProgramOrthogonalPlaneNormal
The orthogonal plane transform after tilting plane transform. Include G17, G18, G19 and plane of called G12p1.
public Vec3d ProgramOrthogonalPlaneNormal { get; }
Property Value
ProgramPos
ProgramPos can be cartesian XYZ or polar XCZ with radius-based X, depends on CoordinateInterpolationMode.
public Vec3d ProgramPos { get; }
Property Value
ProgramXyz
Cartesian Program Position XYZ, Abs Program Position (as G90 position). NC coordinate position is the position processed by modal flags. NC coordinate position is the position after radius compensation. The NC(Program) coordinate position is comprehensible by User. MC NC conversion may raise floating error. The floating error raise the cutting force issue, especially for bottom cutting force. Hence the NC values have to be memorized.
public Vec3d ProgramXyz { get; }
Property Value
Remarks
NC is the better source property than MC. Ex. a NC line command: X100. The Y and Z value may vary if using MC converting back to NC. The error of Y and Z will keeps accumulating until the next explicit YZ command assignment. The error maybe up to 3e-5 in current case. the bounding box size of the case is not large (TT.20230815). Also note that if using Arc command for a complete circle, the begin NC XYZ and the end NC XYZ have to be equaled. Otherwise, it will become only a very small arc rather than the circle. So be care that do not change the NC XYZ if not needed.
RadiusCompensationBuf
Internal use.
public RadiusCompensationBuf RadiusCompensationBuf { get; set; }
Property Value
S
S. Spindle speed.
public int S { get; set; }
Property Value
SpindleSpeed_radds
Spindle speed in radian/s.
public double SpindleSpeed_radds { get; set; }
Property Value
SpindleSpeed_rpm
Spindle speed in RPM.
public double SpindleSpeed_rpm { get; set; }
Property Value
T
Current equiped Tool ID.
public int T { get; set; }
Property Value
TiltPlaneNcArg
Arguments related to tilted plane operations.
public ITiltPlaneNcArg TiltPlaneNcArg { get; set; }
Property Value
Methods
GetAttacherMat(NcEnv)
Gets the attacher transformation matrix for the current machine coordinates.
public Mat4d GetAttacherMat(NcEnv ncEnv)
Parameters
ncEnv
NcEnvThe NC environment.
Returns
- Mat4d
The attacher transformation matrix.
GetCompensationHeight(NcEnv, IMessageKit)
Gets the tool height compensation value for this NC line.
public double GetCompensationHeight(NcEnv ncEnv, IMessageKit messageHost)
Parameters
ncEnv
NcEnvNC environment
messageHost
IMessageKitMessage host for warnings
Returns
- double
Height compensation value
GetCompensationRadius(CncBrand, MillingToolOffsetTable, IMessageKit)
Gets the tool radius compensation value for this NC line.
public double GetCompensationRadius(CncBrand cncBrand, MillingToolOffsetTable millingToolOffsetTable, IMessageKit messageHost)
Parameters
cncBrand
CncBrandCNC brand
millingToolOffsetTable
MillingToolOffsetTableMilling tool offset table
messageHost
IMessageKitMessage host for warnings
Returns
- double
Radius compensation value
GetFileLineIndex()
Get FileLineIndex.
public FileLineIndex GetFileLineIndex()
Returns
GetG5xCoordinateOffset(NcEnv)
Gets the G5x coordinate offset for this NC line.
public Vec3d GetG5xCoordinateOffset(NcEnv ncEnv)
Parameters
ncEnv
NcEnvNC environment
Returns
- Vec3d
The G5x coordinate offset vector
GetIndexedFileLine()
Gets the file line associated with this object.
public IndexedFileLine GetIndexedFileLine()
Returns
- IndexedFileLine
The file line object.
GetMcByProgramPos(Vec3d, NcEnv, NcNoteCache, IMessageKit, out Vec3d)
Internal Use.
public DVec3d GetMcByProgramPos(Vec3d programPos, NcEnv ncEnv, NcNoteCache ncLineCache, IMessageKit messageHost, out Vec3d programXyz)
Parameters
programPos
Vec3dncEnv
NcEnvncLineCache
NcNoteCachemessageHost
IMessageKitprogramXyz
Vec3d
Returns
GetProgramXyzabc(NcEnv, DVec3d, out bool?, IMessageKit)
Gets the program XYZABC coordinates from machine coordinates.
public DVec3d GetProgramXyzabc(NcEnv ncEnv, DVec3d mcXyzabc, out bool? isG68p2Successed, IMessageKit messageHost)
Parameters
ncEnv
NcEnvThe NC environment.
mcXyzabc
DVec3dThe machine coordinates.
isG68p2Successed
bool?Output parameter indicating whether G68.2 coordinate conversion was successful.
messageHost
IMessageKitThe message host for logging.
Returns
- DVec3d
The program XYZABC coordinates.
GetSourceCommand()
Gets the source command associated with this instance.
public ISourceCommand GetSourceCommand()
Returns
- ISourceCommand
The source command object.
GetTiltMat4d(NcEnv, out Mat4d)
Internal Use Only.
public bool? GetTiltMat4d(NcEnv ncEnv, out Mat4d tableToFeatureTransform)
Parameters
ncEnv
NcEnvNC environment.
tableToFeatureTransform
Mat4dTransform from NC to Table without tool compensation and linear coordinate offset (such as G55,G56..).
Returns
- bool?
True if G68.2 is successfully applied, false if not, and null if not applicable.
HasSyntexXyz(NcEnv)
Determines whether the line contains syntactic XYZ coordinates.
public bool HasSyntexXyz(NcEnv ncEnv)
Parameters
ncEnv
NcEnvNC environment
Returns
- bool
True if syntactic XYZ coordinates are present; otherwise, false.
RebuildByMc(NcEnv, DVec3d, NcNoteCache, IMessageKit)
Internal Use Only. For NC opt.
public void RebuildByMc(NcEnv ncEnv, DVec3d mc, NcNoteCache ncLineCache, IMessageKit messageHost)
Parameters
ncEnv
NcEnvNC environment.
mc
DVec3dMC coordinates.
ncLineCache
NcNoteCacheNC line cache.
messageHost
IMessageKitMessage host for logging and reporting.
RebuildByProgramXyz(NcEnv, Vec3d, NcNoteCache, IMessageKit)
Internal Use Only. For NC opt.
public void RebuildByProgramXyz(NcEnv ncEnv, Vec3d programXyz, NcNoteCache ncNoteCache, IMessageKit messageHost)
Parameters
ncEnv
NcEnvNC environment.
programXyz
Vec3dProgram XYZ coordinates.
ncNoteCache
NcNoteCacheNC note cache.
messageHost
IMessageKitMessage host for logging and reporting.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.