• DuetAPI
  • DuetAPIClient
  • DuetControlServer
  • DuetWebServer
Show / Hide Table of Contents
  • DuetAPI
    • CodeChannel
  • DuetAPI.Commands
    • Acknowledge
    • AddHttpEndpoint
    • AddUserSession
    • BaseCommand
    • BaseResponse
    • Cancel
    • CheckPassword
    • Code
    • CodeFlags
    • CodeParameter
    • CodeParameterConverter
    • CodeParserBuffer
    • CodeParserException
    • CodeType
    • Command
    • Command<T>
    • ErrorResponse
    • EvaluateExpression
    • Flush
    • GetFileInfo
    • GetObjectModel
    • HttpResponseType
    • Ignore
    • InstallPlugin
    • InstallSystemPackage
    • InvalidateChannel
    • KeywordType
    • LockObjectModel
    • PatchObjectModel
    • ReceivedHttpRequest
    • ReloadPlugin
    • RemoveHttpEndpoint
    • RemoveUserSession
    • Resolve
    • ResolvePath
    • Response<T>
    • SendHttpResponse
    • SetNetworkProtocol
    • SetObjectModel
    • SetPluginData
    • SetPluginProcess
    • SetUpdateStatus
    • SimpleCode
    • StartPlugin
    • StartPlugins
    • StopPlugin
    • StopPlugins
    • SyncObjectModel
    • UninstallPlugin
    • UninstallSystemPackage
    • UnlockObjectModel
    • WriteMessage
  • DuetAPI.Connection
    • ConnectionMode
    • Defaults
    • IncompatibleVersionException
    • InterceptionMode
    • SubscriptionMode
  • DuetAPI.Connection.InitMessages
    • ClientInitMessage
    • CodeStreamInitMessage
    • CommandInitMessage
    • InterceptInitMessage
    • PluginServiceInitMessage
    • ServerInitMessage
    • SubscribeInitMessage
  • DuetAPI.ObjectModel
    • Accelerometer
    • AccessLevel
    • AnalogSensor
    • AnalogSensorType
    • AnalogSensorTypeConverter
    • Axis
    • BeepRequest
    • Board
    • BoardState
    • Build
    • BuildObject
    • ClosedLoop
    • Compatibility
    • CoreKinematics
    • CurrentMove
    • DeltaKinematics
    • DeltaTower
    • DeserializationFailedEventArgs
    • DeserializationFailedEventHandler
    • DirectDisplay
    • Directories
    • DistanceUnit
    • DistanceUnitConverter
    • Driver
    • DriverSettings
    • Endstop
    • EndstopType
    • Extruder
    • ExtruderNonlinear
    • Fan
    • FanThermostaticControl
    • FilamentMonitor
    • FilamentMonitorStatus
    • FilamentMonitorType
    • GCodeFileInfo
    • GCodeFileInfoConverter
    • GpInputPort
    • GpOutputPort
    • HangprinterKinematics
    • Heat
    • Heater
    • HeaterModel
    • HeaterModelPID
    • HeaterMonitor
    • HeaterMonitorAction
    • HeaterMonitorCondition
    • HeaterState
    • HttpEndpoint
    • HttpEndpointType
    • IGrowingModelCollection
    • IModelCollection
    • IModelDictionary
    • IModelObject
    • InputChannel
    • InputChannelState
    • Inputs
    • InputShaping
    • InputShapingType
    • Job
    • Kinematics
    • KinematicsName
    • KinematicsNameConverter
    • LaserFilamentMonitor
    • LaserFilamentMonitorCalibrated
    • LaserFilamentMonitorConfigured
    • Layer
    • Limits
    • LogLevel
    • MachineMode
    • MachineStatus
    • Message
    • MessageBox
    • MessageBoxMode
    • MessageType
    • Microstepping
    • MinMaxCurrent<T>
    • ModelCollection<T>
    • ModelDictionary<TValue>
    • ModelDictionaryConverter
    • ModelGrowingCollection<T>
    • ModelObject
    • MotorsIdleControl
    • Move
    • MoveCalibration
    • MoveCompensation
    • MoveCompensationType
    • MoveDeviations
    • MoveQueueItem
    • MoveRotation
    • MoveSegmentation
    • Network
    • NetworkInterface
    • NetworkInterfaceType
    • NetworkProtocol
    • NetworkState
    • ObjectModel
    • ObjectModelConverter
    • Plugin
    • PluginManifest
    • PolarKinematics
    • Probe
    • ProbeGrid
    • ProbeType
    • PulsedFilamentMonitor
    • PulsedFilamentMonitorCalibrated
    • PulsedFilamentMonitorConfigured
    • RestorePoint
    • RotatingMagnetFilamentMonitor
    • RotatingMagnetFilamentMonitorCalibrated
    • RotatingMagnetFilamentMonitorConfigured
    • SbcPropertyAttribute
    • Scanner
    • ScannerStatus
    • ScaraKinematics
    • Sensors
    • SessionType
    • Skew
    • Spindle
    • SpindleState
    • StallDetectSettings
    • State
    • ThumbnailInfo
    • ThumbnailInfoFormat
    • TiltCorrection
    • TimesLeft
    • Tool
    • ToolRetraction
    • ToolState
    • UserSession
    • Volume
    • ZLeadscrewKinematics
  • DuetAPI.Utility
    • DriverId
    • DriverIdJsonConverter
    • FileLists
    • Heightmap
    • JsonCamelCaseStringEnumConverter
    • JsonCharEnumConverter
    • JsonHelper
    • JsonLowerCaseStringEnumConverter
    • JsonPolymorphicWriteOnlyConverter<T>
    • JsonRegexListConverter
    • JsonShortDateTimeConverter
    • RequiredPermissionsAttribute
    • SbcPermissions
    • SbcPermissionsConverter
  • DuetAPIClient
    • BaseCommandConnection
    • BaseConnection
    • CodeStreamConnection
    • CommandConnection
    • HttpEndpointConnection
    • HttpEndpointUnixSocket
    • HttpEndpointUnixSocket.EndpointRequestReceived
    • InterceptConnection
    • InternalServerException
    • SubscribeConnection
  • DuetControlServer
    • Program
    • Settings
  • DuetControlServer.Codes
    • GCodes
    • Keywords
    • MCodes
    • TCodes
  • DuetControlServer.Commands
    • AddHttpEndpoint
    • AddUserSession
    • CheckPassword
    • Code
    • EvaluateExpression
    • Flush
    • GetFileInfo
    • GetObjectModel
    • IConnectionCommand
    • InstallPlugin
    • InstallSystemPackage
    • InvalidateChannel
    • LockObjectModel
    • PatchObjectModel
    • ReloadPlugin
    • RemoveHttpEndpoint
    • RemoveUserSession
    • ResolvePath
    • SetNetworkProtocol
    • SetObjectModel
    • SetPluginData
    • SetPluginProcess
    • SetUpdateStatus
    • SimpleCode
    • StartPlugin
    • StartPlugins
    • StopPlugin
    • StopPlugins
    • SyncObjectModel
    • UninstallPlugin
    • UninstallSystemPackage
    • UnlockObjectModel
    • WriteMessage
  • DuetControlServer.FileExecution
    • Job
    • Macro
  • DuetControlServer.Files
    • CodeBlock
    • CodeFile
    • FileDirectory
    • FilePath
    • InfoParser
  • DuetControlServer.Files.ImageProcessing
    • IconImageParser
    • ImageParser
    • ImageProcessingException
  • DuetControlServer.IPC
    • Connection
    • LockManager
    • Server
  • DuetControlServer.IPC.Processors
    • Base
    • CodeInterception
    • CodeStream
    • Command
    • ModelSubscription
    • PluginService
  • DuetControlServer.Model
    • Expressions
    • Filter
    • ItemPathNode
    • Observer
    • Observer.PropertyPathChanged
    • PeriodicUpdater
    • PropertyChangeType
    • Provider
    • Updater
  • DuetControlServer.SPI
    • DataTransfer
    • EvaluateExpressionRequest
    • Interface
    • Interface.MovementLock
    • VariableRequest
  • DuetControlServer.SPI.Channel
    • LockRequest
    • Manager
    • Processor
    • State
  • DuetControlServer.SPI.Communication
    • Consts
  • DuetControlServer.SPI.Communication.FirmwareRequests
    • AbortFileHeader
    • CodeBufferUpdateHeader
    • DoCodeHeader
    • EvaluationResultHeader
    • ExecuteMacroHeader
    • FileChunkHeader
    • FileHandleHeader
    • OpenFileHeader
    • PrintPausedHeader
    • PrintPausedReason
    • ReadFileHeader
    • Request
    • SeekFileHeader
  • DuetControlServer.SPI.Communication.SbcRequests
    • AssignFilamentHeader
    • BooleanHeader
    • CodeFlags
    • CodeHeader
    • CodeParameter
    • DeleteLocalVariableHeader
    • FileChunkHeader
    • FileDataHeader
    • GetObjectModelHeader
    • MacroCompleteHeader
    • OpenFileResult
    • PrintStartedHeader
    • PrintStoppedHeader
    • Request
    • SetObjectModelHeader
    • SetVariableHeader
  • DuetControlServer.SPI.Communication.Shared
    • CodeChannelHeader
    • DataType
    • HeightMapHeader
    • MessageHeader
    • MessageTypeFlags
    • PacketHeader
    • PrintStoppedReason
    • StringHeader
    • TransferHeader
    • TransferResponse
  • DuetControlServer.SPI.Serialization
    • Reader
    • Writer
  • DuetControlServer.Utility
    • CRC16
    • CRC32
    • Firmware
    • Logger
    • PriorityThreadRunner
  • DuetWebServer
    • Program
    • Startup
  • DuetWebServer.Authorization
    • Policies
    • SessionKeyAuthenticationHandler
    • SessionKeyAuthenticationSchemeOptions
  • DuetWebServer.Controllers
    • MachineController
    • WebSocketController
  • DuetWebServer.FileProviders
    • DuetFileProvider
  • DuetWebServer.Middleware
    • CustomEndpointMiddleware
    • FallbackMiddleware
    • HttpEndpointConnection
  • DuetWebServer.Services
    • ModelObserver
    • SessionExpiry
  • DuetWebServer.Singletons
    • IModelProvider
    • IModelProvider.WebDirectoryChanged
    • ISessionStorage
    • ModelProvider
    • SessionStorage

Class Job

Main class dealing with a file job

Inheritance
System.Object
Job
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: DuetControlServer.FileExecution
Assembly: DuetControlServer.dll
Syntax
public static class Job
Remarks

Lock this class whenever it is accessed (except for Diagnostics(StringBuilder))

Properties

FileLength

Returns the length of the file being printed in bytes

Declaration
public static long FileLength { get; }
Property Value
Type Description
System.Int64

IsAborted

Indicates if the file print has been aborted

Declaration
public static bool IsAborted { get; }
Property Value
Type Description
System.Boolean

IsCancelled

Indicates if the file print has been cancelled

Declaration
public static bool IsCancelled { get; }
Property Value
Type Description
System.Boolean

IsFileSelected

Indicates if a file has been selected for printing

Declaration
public static bool IsFileSelected { get; }
Property Value
Type Description
System.Boolean

IsPaused

Indicates if the file print has been paused

Declaration
public static bool IsPaused { get; }
Property Value
Type Description
System.Boolean

IsProcessing

Indicates if a print is live

Declaration
public static bool IsProcessing { get; }
Property Value
Type Description
System.Boolean

IsSimulating

Indicates if a file is being simulated

Declaration
public static bool IsSimulating { get; }
Property Value
Type Description
System.Boolean
Remarks

This is volatile to allow fast access without locking the class first

Methods

Abort()

Abort the current print asynchronously. This is called when the print could not complete as expected

Declaration
public static void Abort()

AbortAsync()

Abort the current print asynchronously. This is called when the print could not complete as expected

Declaration
public static async Task AbortAsync()
Returns
Type Description
System.Threading.Tasks.Task

Asynchronous task

Cancel()

Cancel the current print (e.g. when M0/M1 is called)

Declaration
public static void Cancel()

CancelAsync()

Cancel the current print (e.g. when M0/M1 is called)

Declaration
public static async Task CancelAsync()
Returns
Type Description
System.Threading.Tasks.Task

Asynchronous task

Diagnostics(StringBuilder)

Print diagnostics of this class

Declaration
public static async Task Diagnostics(StringBuilder builder)
Parameters
Type Name Description
System.Text.StringBuilder builder

String builder

Returns
Type Description
System.Threading.Tasks.Task

Asynchronous task

GetFilePosition()

Get the current file position

Declaration
public static async Task<long> GetFilePosition()
Returns
Type Description
System.Threading.Tasks.Task<System.Int64>

File position

Lock()

Lock this class

Declaration
public static IDisposable Lock()
Returns
Type Description
System.IDisposable

Disposable lock

LockAsync()

Lock this class asynchronously

Declaration
public static Task<IDisposable> LockAsync()
Returns
Type Description
System.Threading.Tasks.Task<System.IDisposable>

Disposable lock

Pause(Nullable<Int64>, PrintPausedReason)

Called when the print is being paused

Declaration
public static void Pause(long? filePosition, PrintPausedReason pauseReason)
Parameters
Type Name Description
System.Nullable<System.Int64> filePosition

File position where the print was paused

PrintPausedReason pauseReason

Reason why the print has been paused

Resume()

Resume a file print

Declaration
public static void Resume()

Run()

Perform actual print jobs

Declaration
public static async Task Run()
Returns
Type Description
System.Threading.Tasks.Task

SelectFile(String, Boolean)

Start a new file print

Declaration
public static async Task SelectFile(string fileName, bool simulating = false)
Parameters
Type Name Description
System.String fileName

File to print

System.Boolean simulating

Whether the file is being simulated

Returns
Type Description
System.Threading.Tasks.Task

Asynchronous task

Remarks

This class has to be locked when this method is called

SetFilePosition(Int64)

Set the current file position

Declaration
public static async Task SetFilePosition(long filePosition)
Parameters
Type Name Description
System.Int64 filePosition

New file position

Returns
Type Description
System.Threading.Tasks.Task

File position

In This Article
Back to top Generated by DocFX