• Articles
  • Api Documentation
Show / Hide Table of Contents
  • DotnetPostprocessing.SDK
    • ArcBreakMode
    • ArcSettings
    • BrakeAxesEnumerator
    • CLDArray
    • CLDAxisBrake
    • CLDCmdType
    • CLDCmdTypeExtensions
    • CLDConst
    • CLDCycle
    • CLDEDMMotionMode
    • CLDFeedKind
    • CLDFeedUnits
    • CLDFileType
    • CLDInterpMode
    • CLDMultiMotionAxis
    • CLDOriginPositionMode
    • CLDOriginType
    • CLDPlaneType
    • CLDRotationDir
    • CLDSpindleAction
    • CLDSpindleSpeedMode
    • CLDThreadOrient
    • CLDThreadUnits
    • CodeParamType
    • CommonFuncs
    • CountingNCWord
    • EDMRollMode
    • EPostprocessorException
    • IArrayNamedPropertyIndexer
    • IBinaryNCStorage
    • IBooleanNamedPropertyIndexer
    • ICLDAxesBrakeCommand
    • ICLDBrakeAxesIndexer
    • ICLDCircleCommand
    • ICLDClampCommand
    • ICLDCommand
    • ICLDCommentCommand
    • ICLDCoolantCommand
    • ICLDCoolantTubeIndexer
    • ICLDCutComCommand
    • ICLDCycleCommand
    • ICLDDelayCommand
    • ICLDEDMMoveCommand
    • ICLDEDMMoveSpan
    • ICLDEffectorCommand
    • ICLDExtCycleCommand
    • ICLDFeedrateCommand
    • ICLDFile
    • ICLDFileCmdIndexer
    • ICLDFileList
    • ICLDFiniCommand
    • ICLDFromCommand
    • ICLDGoHomeCommand
    • ICLDGotoCommand
    • ICLDInsertCommand
    • ICLDInterpolationCommand
    • ICLDLoadToolCommand
    • ICLDMachineAxesIndexer
    • ICLDMachineAxisInfo
    • ICLDMachineInfo
    • ICLDMachiningTool
    • ICLDMotionCommand
    • ICLDMoveVelocityCommand
    • ICLDMultiArcCommand
    • ICLDMultiArcPoint
    • ICLDMultiAxisArray
    • ICLDMultiGotoCommand
    • ICLDMultiMotionAxesIndexer
    • ICLDMultiMotionCommand
    • ICLDOpStopCommand
    • ICLDOriginCommand
    • ICLDPPFunCommand
    • ICLDPartNoCommand
    • ICLDPhysicGotoCommand
    • ICLDPlaneCommand
    • ICLDPowerCommand
    • ICLDPrintCommand
    • ICLDProject
    • ICLDRapidCommand
    • ICLDSelWorkpieceCommand
    • ICLDSinglePassThreadCommand
    • ICLDSpindleCommand
    • ICLDStopCommand
    • ICLDStructureCommand
    • ICLDSub
    • ICLDSubList
    • ICLDSyncAxesCommand
    • ICLDSyncWaitCommand
    • ICLDTLContactCommand
    • ICLDTakeoverCommand
    • ICLDTechOperation
    • ICLDTechOperationList
    • ICLDTranslator
    • ICodeParametersOfCLDCommand
    • ICodeParametersOfCLDCommandBooleanIndexer
    • ICodeParametersOfCLDCommandFloatIndexer
    • ICodeParametersOfCLDCommandIntegerIndexer
    • ICodeParametersOfCLDCommandStringIndexer
    • IFloatNamedPropertyIndexer
    • IInputBox
    • IInputBoxEnumValuesList<T>
    • IInputBoxFactory
    • IInputBoxProperty
    • IIntegerNamedPropertyIndexer
    • INCBlockOwner
    • INCFileOwner
    • INCLabel
    • INCStorage
    • INCStorageManager
    • INamedPropertiesCollection
    • INamedProperty
    • INamedPropertyIndexer
    • IPPFunTechInfo
    • IPPFunTechInfoPart
    • IPPFunTechInfoSetupStage
    • IPPFunTechInfoTool
    • IPPFunTechInfoWorkpiece
    • IPostprocessingLogReceiver
    • IStringNamedPropertyIndexer
    • ITextNCStorage
    • IToolGeometry
    • InitNamesProc
    • InpArray<T>
    • InpNumber
    • InputBoxEnumValuesFormer<T>
    • InputBoxValueSetter<T>
    • Log
    • LogMessageType
    • MsgBtnSet
    • MsgClickedBtn
    • MsgDefBtn
    • MsgType
    • MultiMotionAxesEnumerator
    • NCBlock
    • NCBlockWordsEnumerator
    • NCLabelSnapMode
    • NCWord
    • NCWordDecPoint
    • NCWordSign
    • NCWordState
    • NCWordTextCase
    • NamedParamType
    • NamedPropIterator
    • NumericNCWord
    • PostprocessorSettings
    • TBinaryNCFile
    • TExternalNCFile
    • TInp2DPoint
    • TInp3DPoint
    • TInp5DPoint
    • TInpComplexRotationConvention
    • TInpLocation
    • TInpQuaternion
    • TInpRotation
    • TInpRotationConvention
    • TNCFile
    • TNCFilesManager
    • TNCStorageType
    • TPostprocessor
    • TSimpleTextNCFile
    • TTextNCFile
    • TextNCWord
    • TrailingZeroesMode
    • TranslitPair
    • TransliterationTable
    • Transliterator
  • GeneralUtils.STDefLib
    • AngleUnits
    • STDef
  • Geometry.GeWatchDNClient
    • STGeWatch
    • STGeWatchClient
  • Geometry.VecMatrLib
    • EVecMatrLibError
    • GWConsts
    • ISTGeWatch
    • ISTGeWatchClient
    • ISTGeWatchable
    • T2DPoint
    • T3DArc
    • T3DCut
    • T3DMatrix
    • T3DPoint
    • T5DPoint
    • TComplexRotationConvention
    • TLocation
    • TQuaternion
    • TRotation
    • TRotationConvention
    • TRotationsConverter
    • VML
  • IPCUtils.SharedMemIPC
    • DelayedProcedure
    • HandleRequestProc
    • HandleStreamProc
    • IPCStream
    • SharedMemClient
    • SharedMemObject
    • SharedMemServer
    • SharememUtils
  • STTypes
    • IST_2DBox
    • IST_2DMatrix
    • IST_2DPoint
    • IST_3DBox
    • IST_3DMatrix
    • IST_3DPoint
    • IST_5DPoint
    • IST_MeasurableObject
    • IST_UpdateStamp
    • TST2DBox
    • TST2DLine
    • TST2DMatrix
    • TST2DPoint
    • TST2IPoint
    • TST2SPoint
    • TST3DBox
    • TST3DLine
    • TST3DMatrix
    • TST3DPoint
    • TST3DVec
    • TST3IPoint
    • TST3SMatrix
    • TST3SPoint
    • TST5DPoint
    • TSTLinearUnits
    • TSTSystemUnits
    • TST_LinearMeasure
    • enumTST_LinearMeasure
    • tagTST2DBox
    • tagTST2DLine
    • tagTST2DMatrix
    • tagTST2DPoint
    • tagTST2IPoint
    • tagTST2SPoint
    • tagTST3DBox
    • tagTST3DLine
    • tagTST3DMatrix
    • tagTST3DPoint
    • tagTST3IPoint
    • tagTST3SMatrix
    • tagTST3SPoint
    • tagTST5DPoint
    • tagTSTLinearUnits
    • tagTSTSystemUnits

Class TSimpleTextNCFile

Simplest implementation of the output file. It is just wrapper around StreamWriter that inherits TNCFile to be possible to manage it using TNCFilesManager. It has no any integration with the CLData Viewer so you will not see in live time any changes of this file in the CLData viewer. It will be shown there after the finish of whole postprocessing only. Use it only if you have some problems with TTextNCFile.

To use TSimpleTextNCFile class just create an instance of it and use WriteLine(string) or Write(string) methods to append some text to the file.

Also you can set the desired encoding TextEncoding of the output file.

Inheritance
object
TNCFile
TSimpleTextNCFile
Implements
INCBlockOwner
Inherited Members
TNCFile.OnInit()
TNCFile.Manager
TNCFile.Owner
Namespace: DotnetPostprocessing.SDK
Assembly: DotnetPostprocessing.SDK.dll
Syntax
public class TSimpleTextNCFile : TNCFile, INCBlockOwner

Constructors

TSimpleTextNCFile()

Initializes a new instance of TSimpleTextNCFile object and assigns TNCFilesManager.Singletone.DefaultNCFilesOwner as an Owner. It assigns UTF-8 without BOM as a desired encoding of the output file (TextEncoding).

Declaration
public TSimpleTextNCFile()

TSimpleTextNCFile(INCFileOwner)

Initializes a new instance of TSimpleTextNCFile object and assigns specified object as an Owner. It assigns new UTF8Encoding(false) (UTF-8 without BOM) as a desired encoding of the output file (TextEncoding).

Declaration
public TSimpleTextNCFile(INCFileOwner Owner)
Parameters
Type Name Description
INCFileOwner Owner

The object that is the owner of the output file formed by the postprocessor. Usually the owner is a postprocessor itself.

TSimpleTextNCFile(INCFileOwner, Encoding)

Initializes a new instance of TSimpleTextNCFile object and assigns specified object as an Owner. It expects the encoding of the output text file as an input parameter.

Declaration
public TSimpleTextNCFile(INCFileOwner Owner, Encoding encoding)
Parameters
Type Name Description
INCFileOwner Owner

The object that is the owner of the output file formed by the postprocessor. Usually the owner is a postprocessor itself.

Encoding encoding

Desired output file encoding. If it is null then default encoding of the StreamWriter class will be used (UTF8 without BOM, TextEncoding).

TSimpleTextNCFile(Encoding)

Initializes a new instance of TSimpleTextNCFile object and assigns TNCFilesManager.Singletone.DefaultNCFilesOwner as an Owner. It expects the encoding of the output text file as an input parameter (TextEncoding).

Declaration
public TSimpleTextNCFile(Encoding encoding)
Parameters
Type Name Description
Encoding encoding

Desired output file encoding. If it is null then default encoding of the StreamWriter class will be used (UTF-8 without BOM).

Properties

OutputFileName

The file name with a full path where this output file should be saved at the finish.

Declaration
public override string OutputFileName { get; set; }
Property Value
Type Description
string
Overrides
TNCFile.OutputFileName

TextEncoding

Desired encoding of the output file. For example, you can use one of the following variants.

  • Encoding.GetEncoding("windows-1251") - with specifying any standard textual name of the encoding.
  • Encoding.UTF8 - UTF-8 with BOM (byte order mark bytes at the start of a file)
  • Encoding.Unicode - UTF-16 using the little endian byte order.
  • Encoding.BigEndianUnicode - UTF-16 using the big endian byte order.
  • Encoding.Default - The default encoding for this .NET implementation.
  • new UTF8Encoding(false) - UTF-8 without BOM will be used.
  • null - UTF-8 without BOM will be used.

You can assign TextEncoding not only at the initialization of new instance of TSimpleTextNCFile but at any time of postprocessing. It will be applied at the finish of whole postprocessing.

Declaration
public Encoding TextEncoding { get; set; }
Property Value
Type Description
Encoding

Methods

Finalize()

Finalizes TSimpleTextNCFile instance and disposes system resources.

Declaration
protected override void Finalize()

Flush()

It should write the buffered in memory data for the output file to a hard drive (to a temporary files, not to the final destination). Usually you don't need to call it manually, the postprocessing system calls it as needed.

Declaration
public override void Flush()
Overrides
TNCFile.Flush()

Output(string)

Writes the specified string with the line break (will be added automatically) to the end of the file.

Declaration
public void Output(string s)
Parameters
Type Name Description
string s

The string you want to write.

SaveToFile(string)

This method is called by the system automatically at the most final stage of the postprocessor's work. Here the content of the file should be written from a temporary storage (in memory or temporary file) to the destination file specified in the OutputFileName property.

After this saving the OnFinalizeNCFiles(TNCFilesManager) handler of the postprocessor is called where you can implement some additional actions on the output files.

Declaration
public override void SaveToFile(string fileName)
Parameters
Type Name Description
string fileName

The destination file path.

Overrides
TNCFile.SaveToFile(string)

Write(string)

Writes the specified string to the end of the file. No line break is added.

Declaration
public void Write(string s)
Parameters
Type Name Description
string s

The string you want to write.

Write(string, INCLabel)

Attention! This feature doesn't supported by the TSimpleTextNCFile class. It will throw the EPostprocessorException exception.

To be possible to use random position file writing with INCLabel use TTextNCFile instead.

Declaration
public void Write(string s, INCLabel label)
Parameters
Type Name Description
string s
INCLabel label
Exceptions
Type Condition
EPostprocessorException

WriteLine()

Writes the line break to the end of the file.

Declaration
public void WriteLine()

WriteLine(string)

Writes the specified string with the line break (will be added automatically) to the end of the file.

Declaration
public void WriteLine(string s)
Parameters
Type Name Description
string s

The string you want to write.

WriteLine(string, INCLabel)

Attention! This feature doesn't supported by the TSimpleTextNCFile class. It will throw the EPostprocessorException exception.

To be possible to use random position file writing with INCLabel use TTextNCFile instead.

Declaration
public void WriteLine(string s, INCLabel label)
Parameters
Type Name Description
string s
INCLabel label
Exceptions
Type Condition
EPostprocessorException

Implements

INCBlockOwner
In this article
Back to top Generated by DocFX