public class Plugin
extends java.lang.Object
To implement the desired functionality the appropriate method should be overridden.
With the exception of the setConnectionState
and getConnectionState
all methdos in this base class are no-ops, so there is no need to call the
superclass methods in the derived class.
With the exception of onCreateGCodeCompilerExtension
none of the
plugins should override the same onCreate...
method. If EazyCNC
finds multiple declarations it will use the first one, issue a warning and
igonre the rest.
Constructor and Description |
---|
Plugin() |
Modifier and Type | Method and Description |
---|---|
ConnectionState |
getConnectionState()
returns the connection state as set by the last call to
setConnectionState . |
Layout |
onCreateAxisSetupView()
creates and returns a layout that will replace the built-in axis setup view.
|
Layout |
onCreateCoordinatesView()
creates and returns a layout that will replace the built-in coordinate setup view.
|
Layout |
onCreateDROPanel()
creates and returns a layout that will replace the built-in coordinate display (DRO) panel.
|
Layout |
onCreateFeedPanel()
creates and returns a layout that will replace the built-in feed control panel.
|
Layout |
onCreateFixedPanelsView()
creates and returns a layout that will replace all of the fixed panels on the lower half of the EazyCNC screen.
|
GCodeCompilerExtension |
onCreateGCodeCompilerExtension()
creates and returns a
GCodeCompilerExtension that will be used to process and interpret G-codes. |
Layout |
onCreateGCodePanel()
creates and returns a layout that will replace the built-in G-code display panel.
|
Layout |
onCreateJogPanel()
creates and returns a layout that will replace the built-in jog controls panel.
|
Layout |
onCreateMachControlButtons()
creates and returns a layout that will replace the built-in mach control buttons.
|
Layout |
onCreateMachControlsPanel()
creates and returns a layout that will replace the built-in machine control panels.
|
Layout |
onCreateMachSetupView()
creates and returns a layout that will replace the built-in machine setup view.
|
Layout |
onCreateMachView()
creates and returns a layout that will replace the built-in tool-path/G-code view.
|
MotorController |
onCreateMotorController()
creates and returns a
MotorController that will then replace EazyCNC's built-in one. |
Layout |
onCreateSpindlePanel()
creates and returns a layout that will replace the built-in spindle control panel.
|
Layout |
onCreateToolpathPanel()
creates and returns a layout that will replace the built-in 3D tool-path panel.
|
ToolpathRenderer |
onCreateToolpathRenderer()
creates and returns a
ToolpathRenderer that will then replace EazyCNC's built-in one. |
ToolRenderer |
onCreateToolRenderer()
creates and returns a
ToolRenderer that will then replace EazyCNC's built-in one. |
Layout |
onCreateToolSetupView()
creates and returns a layout that will replace the built-in tool table setup view.
|
Layout |
onCreateUserFuncPanel()
creates and returns a layout that will replace the built-in work user function-buttons view.
|
Layout |
onCreateViewButtons(Variable viewVariable,
CardLayout viewStack)
creates a view buttons panel that will then replace the EazyCNC's built-in one.
|
Layout |
onCreateWorkOffsetsView()
creates and returns a layout that will replace the built-in work offset setup view.
|
void |
onExit()
get called when EazyCNC is exiting.
|
void |
onInit()
gets called right after the plugin is instantiated.
|
void |
onLoad(java.lang.String filename)
gets called some time after
onInit has been called . |
void |
onSave(java.lang.String filename)
gets called everytime the user clicks the SAVE button.
|
boolean |
onUpdateCoolant(boolean coolantOn,
boolean mist)
gets called every time the coolant state needs to be updated.
|
boolean |
onUpdateSpindle(boolean spindleOn,
boolean forward,
int speed)
gets called every time the spindle state needs to be updated.
|
void |
setConnectionState(ConnectionState status)
sets the connection state for this plugin.
|
public void onInit() throws java.lang.Exception
The method should throw an exception if it is not possible to initialize the plugin for some reason in which case EazyCNC will issue a warning to the user.
java.lang.Exception
- if the initialization fails for some reason.public void onExit()
public ConnectionState getConnectionState()
setConnectionState
.public void setConnectionState(ConnectionState status)
Sub classes that override this should call super.setConnectionState
to set the connection state.
status
- the status to setpublic void onLoad(java.lang.String filename) throws java.lang.Exception
onInit
has been called .
This method should attempt to read the plugin state from the named file if the plugin needs permanent storage. Note that the file may not exist (if this is the first ever run of this plugin or if the user has not clicked the SAVE button). If the file does not exist this method should *noy* throw an exception but use sensical default values for the plugin state.
filename
- name of the file from which to read the statejava.lang.Exception
- if something else than that the file does not exist goes wrong when reading the filepublic void onSave(java.lang.String filename) throws java.lang.Exception
This method must write the plugin state to the named file, if the plugin needs permanent storage.
filename
- name of the file onto which write the statejava.lang.Exception
- if something goes wrong when writing the statepublic boolean onUpdateSpindle(boolean spindleOn, boolean forward, int speed)
This method should be overridden with an implementation that updates
the actual spindle hardware according to the parameters if the
connection state is CONNECTED
. If the connections state
is SIMULATION
the appropriate simulated action should happen.
If the connection state is neither of the above then this method should do nothing.
This method should return true if the EazyCNC built-in spindle control is to be replaced by this method, false if this method works in parallel of the built-in spindle control. This allows for example the communication of the speed info by some other means than the default TOAD4 speed output while still using the default TOAD4 output to control the spindle dir and run signals.
spindleOn
- true if the spindle should be onforward
- true if the spindle direction is forwardspeed
- value of the spindle, [0..255]public boolean onUpdateCoolant(boolean coolantOn, boolean mist)
This method should be overridden with an implementation that updates
the actual coolant hardware according to the parameters if the
connection state is CONNECTED
. If the connections state
is SIMULATION
the appropriate simulated action should happen.
If the connection state is neither of the above then this method should do nothing.
This method should return true if the EazyCNC built-in coolant control is to be replaced by this method, false if this method works in parallel of the built-in coolant control.
coolantOn
- true if the coolant should be onmist
- true if the mist coolant should be onpublic MotorController onCreateMotorController()
MotorController
that will then replace EazyCNC's built-in one.public ToolpathRenderer onCreateToolpathRenderer()
ToolpathRenderer
that will then replace EazyCNC's built-in one.public ToolRenderer onCreateToolRenderer()
ToolRenderer
that will then replace EazyCNC's built-in one.public Layout onCreateViewButtons(Variable viewVariable, CardLayout viewStack)
This method should create a layout and populate it with buttons or other means that the user can use to select (make visible) one of the views in the provided stack layout.
When this method is called the stack layout is already populated with the built in EazyCNC views, custom views can be added to the stack.
viewVariable
- the variable that controls which view is visible/selectedviewStack
- the stack layout that holds all the viewspublic Layout onCreateMachView()
public Layout onCreateCoordinatesView()
public Layout onCreateWorkOffsetsView()
public Layout onCreateAxisSetupView()
public Layout onCreateToolSetupView()
public Layout onCreateMachSetupView()
public Layout onCreateFixedPanelsView()
public Layout onCreateToolpathPanel()
public Layout onCreateGCodePanel()
public Layout onCreateDROPanel()
public Layout onCreateJogPanel()
public Layout onCreateUserFuncPanel()
public Layout onCreateSpindlePanel()
public Layout onCreateFeedPanel()
public Layout onCreateMachControlsPanel()
public Layout onCreateMachControlButtons()
public GCodeCompilerExtension onCreateGCodeCompilerExtension()
GCodeCompilerExtension
that will be used to process and interpret G-codes.
Unlike most of the other plugin methods it is acceptable to have multiple plugins that override this method. This allows for different plugins to provide extension to G-codes.