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
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
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe 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
millingParaICuttingParaThe cutting parameters for optimization
machiningSessionMachiningSessionThe current machining session
srcNcLinesLinkedList<NcLine>The source NC lines to optimize
ncEnvNcEnvThe NC environment settings
millingStepsList<MachiningStep>The list of milling steps
millingToolHouseMachiningToolHouseThe machining tool house
messageHostIMessageHostThe message host for logging
cancellationTokenCancellationTokenCancellation token to cancel the operation
relFileTemplatestringThe 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
millingParaICuttingParaThe cutting parameters for optimization
machiningSessionMachiningSessionThe current machining session
ncLinesLinkedList<NcLine>The NC lines to optimize
ncEnvNcEnvThe 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