Table of Contents

Class NcOptProc

Namespace
Hi.NcOpt
Assembly
HiNc.dll

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 XElement

XML

baseDirectory string

Base 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

int

FeedSettingGapRatio

Gets or sets the ratio used for determining feed setting gaps.

public static double FeedSettingGapRatio { get; set; }

Property Value

double

XName

Name for XML IO.

public static string XName { get; }

Property Value

string

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 string

The base directory for resolving relative paths

relFile string

The 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 ICuttingPara

The cutting parameters for optimization

machiningSession MachiningSession

The current machining session

srcNcLines LinkedList<NcLine>

The source NC lines to optimize

ncEnv NcEnv

The NC environment settings

millingSteps List<MachiningStep>

The list of milling steps

millingToolHouse MachiningToolHouse

The machining tool house

messageHost IMessageHost

The message host for logging

cancellationToken CancellationToken

Cancellation token to cancel the operation

relFileTemplate string

The 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 ICuttingPara

The cutting parameters for optimization

machiningSession MachiningSession

The current machining session

ncLines LinkedList<NcLine>

The NC lines to optimize

ncEnv NcEnv

The NC environment settings

millingToolHouse MachiningToolHouse

The machining tool house

clStrip ClStrip

The cutter location strip

baseDirectory string

The base directory for output files

messageHost IMessageHost

The message host for logging

cancellationToken CancellationToken

Cancellation token to cancel the operation

relFileTemplate string

The relative file template for output files