Table of Contents

Class SubProgramFolderConfig

Namespace
Hi.NcParsers.Dependencys.Generic
Assembly
HiMech.dll

Folder lookup configuration for SubProgramCallSyntax: where to find an O<n> file when the host program executes M98 P_ L_ (InternalFolder) or M198 P_ (ExternalFolder, modelling Fanuc's external storage call — memory card, USB, DNC drive — whose only difference from M98 is the search root).

Either path may be absolute or relative; when relative, it resolves against the host file's parent directory at lookup time. Either may be null — a null ExternalFolder falls back to InternalFolder; a null InternalFolder falls back to the host file's parent directory.

public class SubProgramFolderConfig : INcDependency, IMakeXmlSource
Inheritance
SubProgramFolderConfig
Implements
Inherited Members
Extension Methods

Constructors

SubProgramFolderConfig()

Initializes a new instance with the default “NC” internal folder and null external folder.

public SubProgramFolderConfig()

SubProgramFolderConfig(XElement)

Loads InternalFolder / ExternalFolder from XML produced by MakeXmlSource(string, string, bool); either child element may be absent.

public SubProgramFolderConfig(XElement src)

Parameters

src XElement

Root element named XName.

Properties

ExternalFolder

Folder for M198 P_ lookup, modelling Fanuc's “subprogram on external storage” semantics. Absolute or relative. Null means “fall back to InternalFolder” — a simulator-friendly default for projects that don't actually distinguish internal vs external storage on disk.

public string ExternalFolder { get; set; }

Property Value

string

InternalFolder

Folder for M98 P_ lookup. Absolute or relative; relative is resolved against the host file's parent directory at use time. Null means “use the host file's parent directory directly”. Default “NC” mirrors a typical project layout where the main program sits beside an NC/ subdirectory of subprograms.

public string InternalFolder { get; set; }

Property Value

string

XName

XML element name used to register this dependency with XFactory.

public static string XName { get; }

Property Value

string

Methods

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