Class NcOptProc
Provides functionality for optimizing NC programs by modifying feed rates and tool paths.
public class NcOptProc : IMakeXmlSource
- Inheritance
-
NcOptProc
- Implements
- Inherited Members
- Extension Methods
Constructors
NcOptProc(SequentialBulkReader<MillingStepLuggage>)
Ctor.
public NcOptProc(SequentialBulkReader<MillingStepLuggage> millingStepLuggageReader)
Parameters
millingStepLuggageReaderSequentialBulkReader<MillingStepLuggage>
NcOptProc(XElement, string, SequentialBulkReader<MillingStepLuggage>)
Ctor.
public NcOptProc(XElement src, string baseDirectory, SequentialBulkReader<MillingStepLuggage> millingStepLuggageReader)
Parameters
srcXElementXML
baseDirectorystringBase directory path
millingStepLuggageReaderSequentialBulkReader<MillingStepLuggage>Milling step luggage reader
Properties
CoreNum
Parallel computation thread num. 0 is special number to use all cores.
public static int CoreNum { get; set; }
Property Value
EmbeddedLogMode
Gets or sets the embedded log mode for NC optimization.
public static NcOptimizationEmbeddedLogMode EmbeddedLogMode { get; set; }
Property Value
EnableIndividualStepAdjustmentLog
Enable create log file for building individual NcOptProc.StepAdjustment process.
public static bool EnableIndividualStepAdjustmentLog { get; set; }
Property Value
XName
Name for XML IO.
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.
Optimize(ICuttingPara, MachiningSession, LinkedList<HardNcLine>, HardNcEnv, List<MachiningStep>, MachiningToolHouse, IMessageHost, CancellationToken, string, string)
Optimizes NC lines based on cutting parameters and milling steps.
public IEnumerable<(HardNcLine SrcNcLine, HardNcLine OptNcLine)> Optimize(ICuttingPara millingPara, MachiningSession machiningSession, LinkedList<HardNcLine> srcNcLines, HardNcEnv ncEnv, List<MachiningStep> machiningSteps, MachiningToolHouse millingToolHouse, IMessageHost messageHost, CancellationToken cancellationToken, string baseDirectory, string relFileTemplate)
Parameters
millingParaICuttingParaThe cutting parameters for optimization.
machiningSessionMachiningSessionThe current machining session.
srcNcLinesLinkedList<HardNcLine>The source NC lines to optimize.
ncEnvHardNcEnvThe NC environment settings.
machiningStepsList<MachiningStep>The list of milling steps.
millingToolHouseMachiningToolHouseThe machining tool house.
messageHostIMessageHostThe message host for logging.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
baseDirectorystringThe base directory for file operations.
relFileTemplatestringThe relative file template for output.
Returns
- IEnumerable<(HardNcLine SrcNcLine, HardNcLine OptNcLine)>
Enumerable of source and optimized NC line pairs.
OptimizeToFiles(ICuttingPara, MachiningSession, LinkedList<HardNcLine>, HardNcEnv, MachiningToolHouse, ClStrip, string, IMessageHost, CancellationToken, string)
Optimizes NC lines and writes the results to files.
public void OptimizeToFiles(ICuttingPara millingPara, MachiningSession machiningSession, LinkedList<HardNcLine> ncLines, HardNcEnv ncEnv, MachiningToolHouse millingToolHouse, ClStrip clStrip, string baseDirectory, IMessageHost messageHost, CancellationToken cancellationToken, string relFileTemplate = "Output/Opt-[NcName]")
Parameters
millingParaICuttingParaThe cutting parameters for optimization
machiningSessionMachiningSessionThe current machining session
ncLinesLinkedList<HardNcLine>The NC lines to optimize
ncEnvHardNcEnvThe NC environment settings
millingToolHouseMachiningToolHouseThe machining tool house
clStripClStripThe cutter location strip
baseDirectorystringThe base directory for output files
messageHostIMessageHostThe message host for logging
cancellationTokenCancellationTokenCancellation token to cancel the operation
relFileTemplatestringThe relative file template for output files