C# Class KFlopWebNC.Model.DeviceInteropHandler

Exibir arquivo Open project: parhansson/KMotionX Class Usage Examples

Public Methods

Method Description
CheckAllEnabled ( ) : void
CheckEnabledA ( ) : void

Query command to determine whether the A axis is enabled

CheckEnabledB ( ) : void

Query command to determine whether the B axis is enabled

CheckEnabledC ( ) : void

Query command to determine whether the C axis is enabled

CheckEnabledX ( ) : void

Query command to determine whether the X axis is enabled

CheckEnabledY ( ) : void

Query command to determine whether the Y axis is enabled

CheckEnabledZ ( ) : void

Query command to determine whether the Z axis is enabled

CreateA ( int channel, double movespeed, double jogspeed ) : void
CreateB ( int channel, double movespeed, double jogspeed ) : void
CreateC ( int channel, double movespeed, double jogspeed ) : void
CreateX ( int channel, double movespeed, double jogspeed ) : void
CreateY ( int channel, double movespeed, double jogspeed ) : void
CreateZ ( int channel, double movespeed, double jogspeed ) : void
CyclePause ( ) : void

Command dispatcher for pausing/unpausing the interpreter

CycleStart ( ) : void

Command dispatcher for interpreting a gcode file

DeviceInteropHandler ( ZoomBrowser browser ) : System
ExecuteMDI ( ) : void

Command dispatcher to execute a single RS274 command

GetCommandOptions ( ) : string

Helper method to generate MCode Actions for an HTML select element

GetEditorForCommand ( CommandData command, bool showindex, bool editname ) : string

Generates the specific editor for a Mcode Action command based on its type

InitAxis ( ) : void

This method will create/update individual axis objects based on the Interpreter axis settings

InitInterpreterData ( ) : void

This will update the Interpreter TP params, axis, offset, tools and MCode Actions from the data file

JogANegative ( ) : void

Command dispatcher to jog the A axis in negative direction

JogAPositive ( ) : void

Command dispatcher to jog the A axis in positive direction

JogBNegative ( ) : void

Command dispatcher to jog the B axis in negative direction

JogBPositive ( ) : void

Command dispatcher to jog the B axis in positive direction

JogCNegative ( ) : void

Command dispatcher to jog the C axis in negative direction

JogCPositive ( ) : void

Command dispatcher to jog the C axis in positive direction

JogXNegative ( ) : void

Command dispatcher to jog the X axis in negative direction

JogXPositive ( ) : void

Command dispatcher to jog the X axis in positive direction

JogYNegative ( ) : void

Command dispatcher to jog the Y axis in negative direction

JogYPositive ( ) : void

Command dispatcher to jog the Y axis in positive direction

JogZNegative ( ) : void

Command dispatcher to jog the Z axis in negative direction

JogZPositive ( ) : void

Command dispatcher to jog the Z axis in positive direction

LoadCommandEditor ( int start, int count ) : void

Transfers command data from the data file to the HTML within the supplied range of elements

LoadGcodeFile ( ) : void

Command dispatcher to open a file dialog and select the gcode file

LoadInterpreterAxisEditor ( ) : void

Updates the axis editor HTML from the data file

LoadInterpreterTPEditor ( ) : void

Updates the trajectory planner editor HTML from the data file

LoadOffsetEditor ( int start, int count ) : void

Transfers offset data from the data file to the HTML within the supplied range of elements

LoadToolEditor ( int start, int count ) : void

Transfers tool data from the data file to the HTML within the supplied range of elements

MoveA ( double position ) : void

Moves the A axis to a commanded position

MoveB ( double position ) : void

Moves the B axis to a commanded position

MoveC ( double position ) : void

Moves the C axis to a commanded position

MoveX ( double position ) : void

Moves the X axis to a commanded position

MoveY ( double position ) : void

Moves the Y axis to a commanded position

MoveZ ( double position ) : void

Moves the Z axis to a commanded position

NavigateToPage ( string pagename ) : void
RefreshInterpreterState ( ) : void

Forces an update of the interpreter display settings

ResetGcodeDisplay ( ) : void

Discovers the maximum display lines and loads the Gcode file into the display buffer

RewindProgram ( ) : void

Command dispatcher 'rewind' the interpreter file

RunFromLine ( ) : void

Command dispatcher to execute the gcode from a specific line

RunUserCommand ( int command ) : void

Command dispatcher to invoke a command via the interpreter buffer

SaveCommandEditor ( int start, int count ) : void

Updates the data file commands from the HTML document within the supplied range

SaveInterpreterAxisEditor ( ) : void

Updates the data file axis settings from the HTML document

SaveInterpreterData ( ) : void

Persists Interpreter data to the file

SaveInterpreterTPEditor ( ) : void

Updates the data file trajectory planner from the HTML document

SaveOffsetEditor ( int start, int count ) : void

Updates the data file offsets from the HTML document within the supplied range

SaveToolEditor ( int start, int count ) : void

Updates the data file tools from the HTML document within the supplied range

SetAxis ( string axisname, int channel, double movespeed, double jogspeed ) : void
SetCommandFileName ( int commandindex ) : void

Opens a file dialog and inserts the selection into the command's filename property

SetFeedRate ( double percent ) : void

Command dispatcher to set the Interpreter's feed rate override

SetJogPercentA ( double percent ) : void

Command dispatcher to update the A axis feedrate percentage

SetJogPercentB ( double percent ) : void

Command dispatcher to update the B axis feedrate percentage

SetJogPercentC ( double percent ) : void

Command dispatcher to update the C axis feedrate percentage

SetJogPercentX ( double percent ) : void

Command dispatcher to update the X axis feedrate percentage

SetJogPercentY ( double percent ) : void

Command dispatcher to update the Y axis feedrate percentage

SetJogPercentZ ( double percent ) : void

Command dispatcher to update the Z axis feedrate percentage

StartMonitor ( ) : void

Starts the monitor thread

StopA ( ) : void

Command dispatcher to stop A axis motion

StopB ( ) : void

Command dispatcher to stop B axis motion

StopC ( ) : void

Command dispatcher to stop C axis motion

StopInterpreter ( ) : void

Command dispatcher for halting the interpreter

StopMonitor ( ) : void

Stops the monitor thread

StopX ( ) : void

Command dispatcher to stop X axis motion

StopY ( ) : void

Command dispatcher to stop Y axis motion

StopZ ( ) : void

Command dispatcher to stop Z axis motion

ToggleBlockDelete ( ) : void

Command dispatcher to toggle whether the interpreter will skip escaped blocks

ToggleEnableA ( ) : void

Command dispatcher to enable/disable A

ToggleEnableB ( ) : void

Command dispatcher to enable/disable B

ToggleEnableC ( ) : void

Command dispatcher to enable/disable C

ToggleEnableX ( ) : void

Command dispatcher to enable/disable X

ToggleEnableY ( ) : void

Command dispatcher to enable/disable Y

ToggleEnableZ ( ) : void

Command dispatcher to enable/disable Z

ToggleSimulate ( ) : void

Command dispatcher to toggle whether the interpreter should simulate the file

UpdateAxisData ( ) : void

Updates the axis positions

UpdateBoadVersion ( ) : void

Updates the HTML element designated to display the kflop version

UpdateCommandButtonText ( int start, int count ) : void

Updates the button text for user commands within the supplied range of elements

UpdateConnectionStatus ( ) : void

Updates the HTML element designated to display the connection status

UpdateDocument ( Action action ) : void
UpdateFeedRate ( ) : void

Forces an update to the element designated

UpdateGcodeDisplay ( ) : void

Updates the designated gcode display dv with the current gcode being executed

UpdateJogRates ( ) : void

Forces the text of designated elements to display the jog override percentage for each axis

UpdateSecondaryControls ( ) : void

Updates the secondary controls that do not need to be updated as frequently

ZeroA ( ) : void

Command dispatcher to reset the A axis dest to 0.0

ZeroB ( ) : void

Command dispatcher to reset the B axis dest to 0.0

ZeroC ( ) : void

Command dispatcher to reset the C axis dest to 0.0

ZeroX ( ) : void

Command dispatcher to reset the X axis dest to 0.0

ZeroY ( ) : void

Command dispatcher to reset the Y axis dest to 0.0

ZeroZ ( ) : void

Command dispatcher to reset the Z axis dest to 0.0

_StatusMonitor_DoWork ( object sender, DoWorkEventArgs e ) : void

Updates the status objects from the board

Private Methods

Method Description
InitDevice ( ) : void
Interpreter_InterpreterCompleted ( int status, int lineno, int sequence_number, string err ) : void
Interpreter_InterpreterStatusUpdated ( int lineno, string msg ) : void
Interpreter_InterpreterUserCallbackRequested ( string msg ) : void
Interpreter_InterpreterUserMCodeCallbackRequested ( int code ) : int
Interpreter_Interpreter_CoordMotionArcFeed ( bool ZeroLenAsFullCircles, double DesiredFeedRate_in_per_sec, int plane, double first_end, double second_end, double first_axis, double second_axis, int rotation, double axis_end_point, double first_start, double second_start, double axis_start_point, int sequence_number, int ID ) : void
Interpreter_Interpreter_CoordMotionStraightFeed ( double DesiredFeedRate_in_per_sec, double x, double y, double z, int sequence_number, int ID ) : void
Interpreter_Interpreter_CoordMotionStraightTraverse ( double x, double y, double z, int sequence_number ) : void
LoadUI ( ) : void
ValidateFolders ( ) : void
_Controller_ErrorReceived ( string message ) : void
_Controller_MessageUpdated ( string message ) : int
_GuiHost_DocumentCompleted ( object sender, WebBrowserDocumentCompletedEventArgs e ) : void
_GuiHost_DocumentTitleChanged ( object sender, EventArgs e ) : void
_GuiHost_Navigated ( object sender, WebBrowserNavigatedEventArgs e ) : void
_GuiHost_Navigating ( object sender, WebBrowserNavigatingEventArgs e ) : void

Method Details

CheckAllEnabled() public method

public CheckAllEnabled ( ) : void
return void

CheckEnabledA() public method

Query command to determine whether the A axis is enabled
public CheckEnabledA ( ) : void
return void

CheckEnabledB() public method

Query command to determine whether the B axis is enabled
public CheckEnabledB ( ) : void
return void

CheckEnabledC() public method

Query command to determine whether the C axis is enabled
public CheckEnabledC ( ) : void
return void

CheckEnabledX() public method

Query command to determine whether the X axis is enabled
public CheckEnabledX ( ) : void
return void

CheckEnabledY() public method

Query command to determine whether the Y axis is enabled
public CheckEnabledY ( ) : void
return void

CheckEnabledZ() public method

Query command to determine whether the Z axis is enabled
public CheckEnabledZ ( ) : void
return void

CreateA() public method

public CreateA ( int channel, double movespeed, double jogspeed ) : void
channel int
movespeed double
jogspeed double
return void

CreateB() public method

public CreateB ( int channel, double movespeed, double jogspeed ) : void
channel int
movespeed double
jogspeed double
return void

CreateC() public method

public CreateC ( int channel, double movespeed, double jogspeed ) : void
channel int
movespeed double
jogspeed double
return void

CreateX() public method

public CreateX ( int channel, double movespeed, double jogspeed ) : void
channel int
movespeed double
jogspeed double
return void

CreateY() public method

public CreateY ( int channel, double movespeed, double jogspeed ) : void
channel int
movespeed double
jogspeed double
return void

CreateZ() public method

public CreateZ ( int channel, double movespeed, double jogspeed ) : void
channel int
movespeed double
jogspeed double
return void

CyclePause() public method

Command dispatcher for pausing/unpausing the interpreter
public CyclePause ( ) : void
return void

CycleStart() public method

Command dispatcher for interpreting a gcode file
public CycleStart ( ) : void
return void

DeviceInteropHandler() public method

public DeviceInteropHandler ( ZoomBrowser browser ) : System
browser ZoomBrowser
return System

ExecuteMDI() public method

Command dispatcher to execute a single RS274 command
public ExecuteMDI ( ) : void
return void

GetCommandOptions() public method

Helper method to generate MCode Actions for an HTML select element
public GetCommandOptions ( ) : string
return string

GetEditorForCommand() public method

Generates the specific editor for a Mcode Action command based on its type
public GetEditorForCommand ( CommandData command, bool showindex, bool editname ) : string
command CommandData command source to generate editor for
showindex bool flag to determine whether or not to create a p element displaying the command index
editname bool flag to determine whether the command name text is editable or not
return string

InitAxis() public method

This method will create/update individual axis objects based on the Interpreter axis settings
public InitAxis ( ) : void
return void

InitInterpreterData() public method

This will update the Interpreter TP params, axis, offset, tools and MCode Actions from the data file
public InitInterpreterData ( ) : void
return void

JogANegative() public method

Command dispatcher to jog the A axis in negative direction
public JogANegative ( ) : void
return void

JogAPositive() public method

Command dispatcher to jog the A axis in positive direction
public JogAPositive ( ) : void
return void

JogBNegative() public method

Command dispatcher to jog the B axis in negative direction
public JogBNegative ( ) : void
return void

JogBPositive() public method

Command dispatcher to jog the B axis in positive direction
public JogBPositive ( ) : void
return void

JogCNegative() public method

Command dispatcher to jog the C axis in negative direction
public JogCNegative ( ) : void
return void

JogCPositive() public method

Command dispatcher to jog the C axis in positive direction
public JogCPositive ( ) : void
return void

JogXNegative() public method

Command dispatcher to jog the X axis in negative direction
public JogXNegative ( ) : void
return void

JogXPositive() public method

Command dispatcher to jog the X axis in positive direction
public JogXPositive ( ) : void
return void

JogYNegative() public method

Command dispatcher to jog the Y axis in negative direction
public JogYNegative ( ) : void
return void

JogYPositive() public method

Command dispatcher to jog the Y axis in positive direction
public JogYPositive ( ) : void
return void

JogZNegative() public method

Command dispatcher to jog the Z axis in negative direction
public JogZNegative ( ) : void
return void

JogZPositive() public method

Command dispatcher to jog the Z axis in positive direction
public JogZPositive ( ) : void
return void

LoadCommandEditor() public method

Transfers command data from the data file to the HTML within the supplied range of elements
public LoadCommandEditor ( int start, int count ) : void
start int beginning command to load
count int last command to update
return void

LoadGcodeFile() public method

Command dispatcher to open a file dialog and select the gcode file
public LoadGcodeFile ( ) : void
return void

LoadInterpreterAxisEditor() public method

Updates the axis editor HTML from the data file
public LoadInterpreterAxisEditor ( ) : void
return void

LoadInterpreterTPEditor() public method

Updates the trajectory planner editor HTML from the data file
public LoadInterpreterTPEditor ( ) : void
return void

LoadOffsetEditor() public method

Transfers offset data from the data file to the HTML within the supplied range of elements
public LoadOffsetEditor ( int start, int count ) : void
start int beginning offset to load
count int last offset to load
return void

LoadToolEditor() public method

Transfers tool data from the data file to the HTML within the supplied range of elements
public LoadToolEditor ( int start, int count ) : void
start int beginning tool to load
count int last tool to load
return void

MoveA() public method

Moves the A axis to a commanded position
public MoveA ( double position ) : void
position double new position to move axis to
return void

MoveB() public method

Moves the B axis to a commanded position
public MoveB ( double position ) : void
position double new position to move axis to
return void

MoveC() public method

Moves the C axis to a commanded position
public MoveC ( double position ) : void
position double new position to move axis to
return void

MoveX() public method

Moves the X axis to a commanded position
public MoveX ( double position ) : void
position double new position to move axis to
return void

MoveY() public method

Moves the Y axis to a commanded position
public MoveY ( double position ) : void
position double new position to move axis to
return void

MoveZ() public method

Moves the Z axis to a commanded position
public MoveZ ( double position ) : void
position double new position to move axis to
return void

NavigateToPage() public method

public NavigateToPage ( string pagename ) : void
pagename string
return void

RefreshInterpreterState() public method

Forces an update of the interpreter display settings
public RefreshInterpreterState ( ) : void
return void

ResetGcodeDisplay() public method

Discovers the maximum display lines and loads the Gcode file into the display buffer
public ResetGcodeDisplay ( ) : void
return void

RewindProgram() public method

Command dispatcher 'rewind' the interpreter file
public RewindProgram ( ) : void
return void

RunFromLine() public method

Command dispatcher to execute the gcode from a specific line
public RunFromLine ( ) : void
return void

RunUserCommand() public method

Command dispatcher to invoke a command via the interpreter buffer
public RunUserCommand ( int command ) : void
command int command to to run contained in the Mcode Action list
return void

SaveCommandEditor() public method

Updates the data file commands from the HTML document within the supplied range
public SaveCommandEditor ( int start, int count ) : void
start int beginning command to save
count int last command to update
return void

SaveInterpreterAxisEditor() public method

Updates the data file axis settings from the HTML document
public SaveInterpreterAxisEditor ( ) : void
return void

SaveInterpreterData() public method

Persists Interpreter data to the file
public SaveInterpreterData ( ) : void
return void

SaveInterpreterTPEditor() public method

Updates the data file trajectory planner from the HTML document
public SaveInterpreterTPEditor ( ) : void
return void

SaveOffsetEditor() public method

Updates the data file offsets from the HTML document within the supplied range
public SaveOffsetEditor ( int start, int count ) : void
start int beginning offset to save
count int last offset to update
return void

SaveToolEditor() public method

Updates the data file tools from the HTML document within the supplied range
public SaveToolEditor ( int start, int count ) : void
start int beginning tool to save
count int last tool to update
return void

SetAxis() public method

public SetAxis ( string axisname, int channel, double movespeed, double jogspeed ) : void
axisname string
channel int
movespeed double
jogspeed double
return void

SetCommandFileName() public method

Opens a file dialog and inserts the selection into the command's filename property
public SetCommandFileName ( int commandindex ) : void
commandindex int command to set file name for
return void

SetFeedRate() public method

Command dispatcher to set the Interpreter's feed rate override
public SetFeedRate ( double percent ) : void
percent double
return void

SetJogPercentA() public method

Command dispatcher to update the A axis feedrate percentage
public SetJogPercentA ( double percent ) : void
percent double percentage to derive jog speed
return void

SetJogPercentB() public method

Command dispatcher to update the B axis feedrate percentage
public SetJogPercentB ( double percent ) : void
percent double percentage to derive jog speed
return void

SetJogPercentC() public method

Command dispatcher to update the C axis feedrate percentage
public SetJogPercentC ( double percent ) : void
percent double percentage to derive jog speed
return void

SetJogPercentX() public method

Command dispatcher to update the X axis feedrate percentage
public SetJogPercentX ( double percent ) : void
percent double percentage to derive jog speed
return void

SetJogPercentY() public method

Command dispatcher to update the Y axis feedrate percentage
public SetJogPercentY ( double percent ) : void
percent double percentage to derive jog speed
return void

SetJogPercentZ() public method

Command dispatcher to update the Z axis feedrate percentage
public SetJogPercentZ ( double percent ) : void
percent double percentage to derive jog speed
return void

StartMonitor() public method

Starts the monitor thread
public StartMonitor ( ) : void
return void

StopA() public method

Command dispatcher to stop A axis motion
public StopA ( ) : void
return void

StopB() public method

Command dispatcher to stop B axis motion
public StopB ( ) : void
return void

StopC() public method

Command dispatcher to stop C axis motion
public StopC ( ) : void
return void

StopInterpreter() public method

Command dispatcher for halting the interpreter
public StopInterpreter ( ) : void
return void

StopMonitor() public method

Stops the monitor thread
public StopMonitor ( ) : void
return void

StopX() public method

Command dispatcher to stop X axis motion
public StopX ( ) : void
return void

StopY() public method

Command dispatcher to stop Y axis motion
public StopY ( ) : void
return void

StopZ() public method

Command dispatcher to stop Z axis motion
public StopZ ( ) : void
return void

ToggleBlockDelete() public method

Command dispatcher to toggle whether the interpreter will skip escaped blocks
public ToggleBlockDelete ( ) : void
return void

ToggleEnableA() public method

Command dispatcher to enable/disable A
public ToggleEnableA ( ) : void
return void

ToggleEnableB() public method

Command dispatcher to enable/disable B
public ToggleEnableB ( ) : void
return void

ToggleEnableC() public method

Command dispatcher to enable/disable C
public ToggleEnableC ( ) : void
return void

ToggleEnableX() public method

Command dispatcher to enable/disable X
public ToggleEnableX ( ) : void
return void

ToggleEnableY() public method

Command dispatcher to enable/disable Y
public ToggleEnableY ( ) : void
return void

ToggleEnableZ() public method

Command dispatcher to enable/disable Z
public ToggleEnableZ ( ) : void
return void

ToggleSimulate() public method

Command dispatcher to toggle whether the interpreter should simulate the file
public ToggleSimulate ( ) : void
return void

UpdateAxisData() public method

Updates the axis positions
public UpdateAxisData ( ) : void
return void

UpdateBoadVersion() public method

Updates the HTML element designated to display the kflop version
public UpdateBoadVersion ( ) : void
return void

UpdateCommandButtonText() public method

Updates the button text for user commands within the supplied range of elements
public UpdateCommandButtonText ( int start, int count ) : void
start int beginning button to update
count int last button to update
return void

UpdateConnectionStatus() public method

Updates the HTML element designated to display the connection status
public UpdateConnectionStatus ( ) : void
return void

UpdateDocument() public method

public UpdateDocument ( Action action ) : void
action Action
return void

UpdateFeedRate() public method

Forces an update to the element designated
public UpdateFeedRate ( ) : void
return void

UpdateGcodeDisplay() public method

Updates the designated gcode display dv with the current gcode being executed
public UpdateGcodeDisplay ( ) : void
return void

UpdateJogRates() public method

Forces the text of designated elements to display the jog override percentage for each axis
public UpdateJogRates ( ) : void
return void

UpdateSecondaryControls() public method

Updates the secondary controls that do not need to be updated as frequently
public UpdateSecondaryControls ( ) : void
return void

ZeroA() public method

Command dispatcher to reset the A axis dest to 0.0
public ZeroA ( ) : void
return void

ZeroB() public method

Command dispatcher to reset the B axis dest to 0.0
public ZeroB ( ) : void
return void

ZeroC() public method

Command dispatcher to reset the C axis dest to 0.0
public ZeroC ( ) : void
return void

ZeroX() public method

Command dispatcher to reset the X axis dest to 0.0
public ZeroX ( ) : void
return void

ZeroY() public method

Command dispatcher to reset the Y axis dest to 0.0
public ZeroY ( ) : void
return void

ZeroZ() public method

Command dispatcher to reset the Z axis dest to 0.0
public ZeroZ ( ) : void
return void

_StatusMonitor_DoWork() public method

Updates the status objects from the board
public _StatusMonitor_DoWork ( object sender, DoWorkEventArgs e ) : void
sender object background worker's dispatch object
e DoWorkEventArgs background worker arguments
return void