Class SoftNcUtil
public static class SoftNcUtil
- Inheritance
-
SoftNcUtil
- Inherited Members
Properties
RegexFlagPrefix
Regex prefix pattern that matches word boundary, after digit, after whitespace, or at start of string. The whitespace/start-of-string alternatives are needed for non-word-character prefixes (e.g. Fanuc '#', Siemens '$').
public static string RegexFlagPrefix { get; }
Property Value
Methods
GetOccupiedMotionMode(JsonObject)
Removes empty sub-nodes from Parsing, then removes Parsing itself if empty.
public static string GetOccupiedMotionMode(this JsonObject json)
Parameters
jsonJsonObject
Returns
GetVec3d(JsonObject, string)
Read Vec3d from a sub-object with X/Y/Z keys. Returns null if the section or all three keys are missing.
public static Vec3d GetVec3d(JsonObject json, string sectionKey)
Parameters
jsonJsonObjectsectionKeystring
Returns
GrabDouble(ref string, string, bool)
Grab double value with decimal point judgement: The text is changed by replacing tag and value to empty string.
If enableIntegerShrink is true and no decimal point, the value should be scale by 0.001.
public static double GrabDouble(ref string text, string tag, bool enableIntegerShrink)
Parameters
textstringtext
tagstringtag
enableIntegerShrinkboolIf true and no decimal point exists, the value will be scaled by 0.001.
Returns
- double
double value
GrabFlag(ref string, string)
Grabs and removes a flag from the NC text.
public static bool GrabFlag(ref string text, string regexTag)
Parameters
Returns
- bool
True if the flag was found and removed; otherwise, false.
GrabFlags(ref string, IEnumerable<string>)
public static bool GrabFlags(ref string text, IEnumerable<string> tags)
Parameters
textstringtagsIEnumerable<string>
Returns
HasAnyFlag(string, IEnumerable<string>)
public static bool HasAnyFlag(string text, IEnumerable<string> flags)
Parameters
textstringflagsIEnumerable<string>
Returns
HasAnyFlag(string, string)
public static bool HasAnyFlag(string text, string flag)
Parameters
Returns
HasFlagInArray(JsonObject, string)
Checks if a specific flag string exists in the Parsing.Flags JsonArray.
public static bool HasFlagInArray(this JsonObject parsing, string flag)
Parameters
parsingJsonObjectflagstring
Returns
ParseDouble(JsonNode)
Parses a double from a JsonNode that may be a number or a string. Extends GetDouble(JsonNode) with string parsing support (needed for values from ParameterizedFlagSyntax which stores values as strings like “180”). Returns 0 if null or unparseable.
public static double ParseDouble(this JsonNode node)
Parameters
nodeJsonNode
Returns
RemoveFlagFromArray(JsonObject, string)
Removes a specific flag string from the Parsing.Flags JsonArray.
public static void RemoveFlagFromArray(this JsonObject parsing, string flag)
Parameters
parsingJsonObjectflagstring
SetAndTrimUnparsedText(JsonObject, string)
public static void SetAndTrimUnparsedText(this JsonObject root, string unparsedText)
Parameters
rootJsonObjectunparsedTextstring
SetVec3d(JsonObject, string, Vec3d)
Write Vec3d to a sub-object with X/Y/Z keys.
public static void SetVec3d(JsonObject json, string sectionKey, Vec3d v)
Parameters
jsonJsonObjectsectionKeystringvVec3d