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
millingStepLuggageReader
SequentialBulkReader<MillingStepLuggage>
NcOptProc(XElement, string, SequentialBulkReader<MillingStepLuggage>)
Ctor.
public NcOptProc(XElement src, string baseDirectory, SequentialBulkReader<MillingStepLuggage> millingStepLuggageReader)
Parameters
src
XElementXML
baseDirectory
stringBase directory path
millingStepLuggageReader
SequentialBulkReader<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
FeedSettingGapRatio
Gets or sets the ratio used for determining feed setting gaps.
public static double FeedSettingGapRatio { get; set; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
MakeXmlSource(string, string)
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)
Parameters
baseDirectory
stringThe base directory for resolving relative paths
relFile
stringThe relative file path for the XML source
Returns
- XElement
An XML element representing the object's state
Optimize(ICuttingPara, MachiningSession, LinkedList<NcLine>, NcEnv, List<MachiningStep>, MachiningToolHouse, IMessageHost, CancellationToken, string)
Optimizes NC lines based on cutting parameters and milling steps.
public IEnumerable<(NcLine SrcNcLine, NcLine OptNcLine)> Optimize(ICuttingPara millingPara, MachiningSession machiningSession, LinkedList<NcLine> srcNcLines, NcEnv ncEnv, List<MachiningStep> millingSteps, MachiningToolHouse millingToolHouse, IMessageHost messageHost, CancellationToken cancellationToken, string relFileTemplate)
Parameters
millingPara
ICuttingParaThe cutting parameters for optimization
machiningSession
MachiningSessionThe current machining session
srcNcLines
LinkedList<NcLine>The source NC lines to optimize
ncEnv
NcEnvThe NC environment settings
millingSteps
List<MachiningStep>The list of milling steps
millingToolHouse
MachiningToolHouseThe machining tool house
messageHost
IMessageHostThe message host for logging
cancellationToken
CancellationTokenCancellation token to cancel the operation
relFileTemplate
stringThe relative file template for output
Returns
- IEnumerable<(NcLine SrcNcLine, NcLine OptNcLine)>
Enumerable of source and optimized NC line pairs
OptimizeToFiles(ICuttingPara, MachiningSession, LinkedList<NcLine>, NcEnv, MachiningToolHouse, ClStrip, string, IMessageHost, CancellationToken, string)
Optimizes NC lines and writes the results to files.
public void OptimizeToFiles(ICuttingPara millingPara, MachiningSession machiningSession, LinkedList<NcLine> ncLines, NcEnv ncEnv, MachiningToolHouse millingToolHouse, ClStrip clStrip, string baseDirectory, IMessageHost messageHost, CancellationToken cancellationToken, string relFileTemplate = "Output/Opt-[NcName]")
Parameters
millingPara
ICuttingParaThe cutting parameters for optimization
machiningSession
MachiningSessionThe current machining session
ncLines
LinkedList<NcLine>The NC lines to optimize
ncEnv
NcEnvThe NC environment settings
millingToolHouse
MachiningToolHouseThe machining tool house
clStrip
ClStripThe cutter location strip
baseDirectory
stringThe base directory for output files
messageHost
IMessageHostThe message host for logging
cancellationToken
CancellationTokenCancellation token to cancel the operation
relFileTemplate
stringThe relative file template for output files