Class SoftNcRunner
Configurable NC Runner.
public class SoftNcRunner : IControlRunner, IMakeXmlSource
- Inheritance
-
SoftNcRunner
- Implements
- Inherited Members
- Extension Methods
Constructors
SoftNcRunner()
public SoftNcRunner()
SoftNcRunner(XElement, string, string, IProgress<object>, object[])
public SoftNcRunner(XElement src, string baseDirectory, string relFile, IProgress<object> progress, object[] res = null)
Parameters
Properties
FanucNcRunner
public static SoftNcRunner FanucNcRunner { get; }
Property Value
FileIndexOnRunCommand
Gets the current file index for run commands.
public int FileIndexOnRunCommand { get; }
Property Value
HeidenhainNcRunner
public static SoftNcRunner HeidenhainNcRunner { get; }
Property Value
MazakNcRunner
public static SoftNcRunner MazakNcRunner { get; }
Property Value
NcDependencyList
public List<INcDependency> NcDependencyList { get; set; }
Property Value
NcInitializationList
public List<INcInitializer> NcInitializationList { get; set; }
Property Value
NcSemanticList
public List<INcSemantic> NcSemanticList { get; set; }
Property Value
NcSyntaxList
public List<INcSyntax> NcSyntaxList { get; set; }
Property Value
Segmenter
public ISegmenter Segmenter { get; set; }
Property Value
SiemensNcRunner
public static SoftNcRunner SiemensNcRunner { get; }
Property Value
SyntecNcRunner
public static SoftNcRunner SyntecNcRunner { get; }
Property Value
XName
public static string XName { get; }
Property Value
Methods
ConfigureByMachiningChain(IMachiningChain)
Configures this SoftNcRunner to match the kinematic
chain of a machine tool. Registers every axis
present on the chain into the IMachineAxisConfig in
NcDependencyList (linear or rotary, derived from
whether the chain's transformer implements
IDynamicRotation). When the chain carries any rotary
axis, a NcKinematicsDependency is appended so that
downstream syntaxes / semantics (e.g. G53.1, G68.2,
McLinearMotionSemantic) can resolve
orientation; its KinematicsProvider
is intentionally left null — the owning project service wires it up
after the solver instance is available (see
LocalProjectService.BuildCoordinateConverter).
public void ConfigureByMachiningChain(IMachiningChain chain)
Parameters
chainIMachiningChainThe machining chain whose axes and kinematics the runner should match. No-op when null.
FromLegacyNcEnvXml(XElement, IMachiningChain)
Creates a SoftNcRunner from legacy HardNcEnv XML.
Picks the brand-specific runner by the CncBrand element and
populates dependencies from the legacy XML values. When a
chain is provided, also calls
ConfigureByMachiningChain(IMachiningChain) so the runner's axis
configuration and kinematics dependency reflect the machine tool
loaded alongside the legacy project.
Remove this region when HardNcEnv is fully replaced.
public static SoftNcRunner FromLegacyNcEnvXml(XElement ncEnvXml, IMachiningChain chain = null)
Parameters
ncEnvXmlXElementThe inner XML element of the legacy
HardNcEnv.chainIMachiningChainOptional machining chain for axis/kinematics configuration.
Returns
- SoftNcRunner
A configured SoftNcRunner.
GetFullSyntaxPieceLinkedList(string, IEnumerable<string>, NcDiagnosticProgress, CancellationToken)
public LazyLinkedList<SyntaxPiece> GetFullSyntaxPieceLinkedList(string relFilePath, IEnumerable<string> lines, NcDiagnosticProgress ncDiagnosticProgress, CancellationToken cancellationToken)
Parameters
relFilePathstringlinesIEnumerable<string>ncDiagnosticProgressNcDiagnosticProgresscancellationTokenCancellationToken
Returns
GetSourcedActEntrys(LazyLinkedList<SyntaxPiece>, NcDiagnosticProgress, CancellationToken)
public IEnumerable<SourcedActEntry> GetSourcedActEntrys(LazyLinkedList<SyntaxPiece> syntaxPieceLinkedList, NcDiagnosticProgress ncDiagnosticProgress, CancellationToken cancellationToken)
Parameters
syntaxPieceLinkedListLazyLinkedList<SyntaxPiece>ncDiagnosticProgressNcDiagnosticProgresscancellationTokenCancellationToken
Returns
MakeXmlSource(string, string, bool)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)
Parameters
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif true, the extended file creation is suppressed.
Returns
- XElement
An XML element representing the object's state
Remarks
For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied.
The baseDirectory is typically the folder at the nearest configuration file folder.
Since the folder can be moving with the configuration file.
ResetFileIndex()
Resets the file index to zero.
public void ResetFileIndex()
RunControlLines(string, IEnumerable<string>, SessionProgress, CancellationToken)
Runs raw Control lines and yields source sentence and Act pairs.
public IEnumerable<SourcedActEntry> RunControlLines(string relFilePath, IEnumerable<string> lines, SessionProgress sessionProgress, CancellationToken cancellationToken)
Parameters
relFilePathstringThe relative path of the control file
linesIEnumerable<string>The enumerable collection of command (control code) lines
sessionProgressSessionProgresscancellationTokenCancellationTokenCancellation token to cancel the operation
Returns
- IEnumerable<SourcedActEntry>
Enumerable of source sentence and Act pairs