Table of Contents

Class DwellSyntax

Namespace
Hi.NcParsers.LogicSyntaxs
Assembly
HiMech.dll

Consumes the non-modal G4/G04 dwell sub-section captured by G4Syntax (Parsing.G4 / Parsing.G04) and emits a CompoundMotion with a single Dwell item, which Hi.NcParsers.Semantics.CompoundMotionSemanticUtil resolves into an ActDelay of the dwell duration.

Argument dialects are configured per brand preset:

Because the capture layer owns the whole argument (the F/X/P word lands inside the dwell sub-section, never in Parsing.F / Parsing.X), a dwell block cannot poison the modal Feedrate and its X-word cannot mint a ghost motion — structural fixes for the G04 F60000 feed-poison and G04 X0.5 ghost-motion hazards.

Spindle-revolution dwell needs the modal spindle speed: this syntax must be placed after SpindleSpeedSyntax in the Logic bundle so the block's own modal SpindleSpeed section is already written. When no positive rpm is known the dwell is consumed and recorded via an Unsupported Message (Dwell--SpindleRevUnresolved) instead of being time-simulated — no act is emitted.

When several recognized argument prefixes appear on one block the resolution priority is seconds → milliseconds → revolutions; every recognized key is consumed either way. Unrecognized keys inside the sub-section are left in place so they surface through UnconsumedCheckSyntax.

public class DwellSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
DwellSyntax
Implements
Inherited Members
Extension Methods

Examples

Siemens dialect instance (SecondsPrefixes=[“F”], MillisecondsPrefixes=[], SpindleRevPrefixes=[“S”]) — the G04 F60000 corpus shape: the F is a dwell time in seconds, consumed here without ever touching the modal Feedrate: #BeforeBuild:

{ "Parsing": { "G04": { "F": 60000 } } }

#AfterBuild:

{
  "CompoundMotion": {
    "Term": "G04",
    "Items": [ { "Dwell": { "Time": 60000 } } ]
  }
}

Default Fanuc-family instance — G4 P500 milliseconds: #BeforeBuild:

{ "Parsing": { "G4": { "P": 500 } } }

#AfterBuild:

{
  "CompoundMotion": {
    "Term": "G4",
    "Items": [ { "Dwell": { "Time": 0.5 } } ]
  }
}

Siemens dialect instance — G4 S30 spindle revolutions against the block's modal 600 rpm → 3 s: #BeforeBuild:

{
  "Parsing": { "G4": { "S": 30 } },
  "SpindleSpeed": { "SpindleSpeed_rpm": 600, "Direction": "CW" }
}

#AfterBuild:

{
  "SpindleSpeed": { "SpindleSpeed_rpm": 600, "Direction": "CW" },
  "CompoundMotion": {
    "Term": "G4",
    "Items": [ { "Dwell": { "Time": 3 } } ]
  }
}

Siemens dialect instance — revolution dwell with no known spindle speed: consumed and recorded (Unsupported Message Dwell–SpindleRevUnresolved, not part of the JSON), no act: #BeforeBuild:

{ "Parsing": { "G04": { "S": 30 } } }

#AfterBuild:

{}

Constructors

DwellSyntax()

Initializes a new instance with the default (Fanuc-family) dialect.

public DwellSyntax()

DwellSyntax(XElement)

Initializes a new instance by deserializing from the given XML element.

public DwellSyntax(XElement src)

Parameters

src XElement

Source XML element.

Properties

MillisecondsPrefixes

Argument prefixes holding a dwell time in milliseconds.

public List<string> MillisecondsPrefixes { get; set; }

Property Value

List<string>

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

SecondsPrefixes

Argument prefixes holding a dwell time in seconds.

public List<string> SecondsPrefixes { get; set; }

Property Value

List<string>

SectionKeys

Parsing sub-section keys this syntax consumes — both dwell code spellings as captured verbatim by G4Syntax.

public List<string> SectionKeys { get; set; }

Property Value

List<string>

SpindleRevPrefixes

Argument prefixes holding a dwell length in spindle revolutions.

public List<string> SpindleRevPrefixes { get; set; }

Property Value

List<string>

XName

XML element name used to register this syntax with XFactory.

public static string XName { get; }

Property Value

string

Methods

Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)

Build syntax arrangement into the syntaxPieceNode in-place.

public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)

Parameters

syntaxPieceNode LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>
ncDiagnosticProgress NcDiagnosticProgress

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

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if 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.

Reg(XFactory)

Registers this type's deserializer with the given XFactory (or Default when factory is null). Idempotent.

public static void Reg(XFactory factory = null)

Parameters

factory XFactory