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
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
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
XName
XML element name used to register this dependency with XFactory.
public static string XName { get; }
Property Value
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
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.
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
factoryXFactory