src/api/model/axis.ts
This class encapsulates current state for an axis in the system.
This entity is present on getCnc().getChannel(channel).axes.
// Minimal object setup
const comm = new CommHmiNodeServer();
const cnc = new Cnc(comm);
// This variable will reference an axis
let Xaxis;
// We are going to request cnc to be pushing every change on hte model
comm.on('online', () => cnc.requestModel());
// Listen to model creation event, so X axis is ready.
cnc.on('created',() => {
Xaxis = cnc.getAxis('X', 'name');
});
// Listen to an external event
$("#button").on('click', () => {
console.log("This is the X axis Object:", Xaxis);
console.log("Axis apos field: ", Xaxis.apos);
console.log("Axis atippos field: ", Xaxis.atippos);
console.log("Axis atiptpos field: ", Xaxis.atiptpos);
console.log("Axis axismain field: ", Xaxis.axismain);
console.log("Axis axistype field: ", Xaxis.axistype);
console.log("Axis channelIndex field: ", Xaxis.channelIndex);
console.log("Axis diameters field: ", Xaxis.diameters);
console.log("Axis enable field: ", Xaxis.enable);
console.log("Axis fix field: ", Xaxis.fix);
console.log("Axis flwact field: ", Xaxis.flwact);
console.log("Axis flwe field: ", Xaxis.flwe);
console.log("Axis genmpgactive field: ", Xaxis.genmpgactive);
console.log("Axis hashForChannel field: ", Xaxis.hashForChannel);
console.log("Axis individualWheelAssociated field: ", Xaxis.individualWheelAssociated);
console.log("Axis logicId field: ", Xaxis.logicId);
console.log("Axis manmode field: ", Xaxis.manmode);
console.log("Axis name field: ", Xaxis.name);
console.log("Axis org field: ", Xaxis.org);
console.log("Axis pos field: ", Xaxis.pos);
console.log("Axis ppos field: ", Xaxis.ppos);
console.log("Axis tippos field: ", Xaxis.tippos);
console.log("Axis tiptpos field: ", Xaxis.tiptpos);
console.log("Axis togo field: ", Xaxis.togo);
console.log("Axis tpos field: ", Xaxis.tpos);
});
// we must connect to cnc server to
comm.connect('localhost', '3000');
Base
Properties |
|
Methods |
Public apos |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
apos. Real part coordinates of the tool base. |
Public atippos |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
atippos. Real part coordinates of the tool tip. |
Public atiptpos |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
atiptpos. Theoretical part coordinates of the tool tip. |
Public axismain |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
axismain. if an axis is part of "triedro" or "plane" |
Public axistype |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
axistype. Parameterized axis type (1 = Linear axis, 2 = Rotary axis, 4 = Spindle) |
Public channelIndex |
Type : number
|
Default value : 0
|
Decorators :
@Listenable()
|
channelIndex. The index of the axis on the active channel. |
Public cncNodeIndex |
Type : number | Variable
|
Default value : 0
|
Decorators :
@Listenable()
|
cncNodeIndex. Index of the cnc node that belongs. |
Public diameters |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable({hooks: undefined})
|
diameters active |
Public enable |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable({hooks: undefined})
|
enable. The CNC activates this mark to allow moving the axis |
Public fix |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
fix. Number of current fixture. |
Public flwact |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
flwact. Following error (lag) with respect to the external feedback (direct feedback). |
Public flwe |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
flwe. Following error, lag (difference between the theoretical position value and the actual, real, position value of the axis). |
Public genmpgactive |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
genmpgactive. If true, the axis is in handwheel mode. |
Public individualWheelAssociated |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable({hooks: undefined})
|
individualWheelAssociated. If true there is an individual wheel associated to axis |
Public inhibit |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable({hooks: undefined})
|
inhibit. If true, the CNC inhibits any movement of the axis. |
Public inUse |
Type : boolean
|
Default value : false
|
Decorators :
@Listenable()
|
inUse. Boolean flag that indicates if axis is in use |
Public logicId |
Type : number
|
Default value : 0
|
Decorators :
@Listenable({hooks: undefined})
|
logicId. The unique logic numeric identification (started from 1) of the axis. |
Public manmode |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable({hooks: undefined})
|
manmode. Axis active movement type values: 1 wheel mode, 2 countinuos mode, 3 incremental mode, 4 wheel mode but not axis selected |
Public name |
Type : string
|
Default value : ""
|
Decorators :
@Listenable({hooks: undefined})
|
name. The ascii name of the axis. (eventable) |
Public org |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
org. Value of the active zero offset (absolute G159 + incremental G158). |
Public parked |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable({hooks: undefined})
|
parked. If true, the CNC parks the axis. |
Public pos |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
pos. Real machine coordinates of the tool base. |
Public ppos |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
ppos. Programmed part coordinates. |
Public tippos |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
tippos. Real machine coordinates of the tool tip. |
Public tiptpos |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
tiptpos. Theoretical machine coordinates of the tool tip. |
Public togo |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
togo. Distance left (to go) for the axis to reach the programmed coordinate. |
Public torque |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
torque. Current torque on the master or slave axis of the tandem. |
Public tpos |
Type : Variable
|
Default value : <Variable>{}
|
Decorators :
@Listenable()
|
tpos. Theoretical machine coordinates of the tool base. |
createListener | ||||||||
createListener(props: Array
|
||||||||
This method will return a custom listener object designed for listening to changes on some concrete properties. Pooling can be avoived, so it can represent a significant better performance.
Various listeners can be instantiated at the same time.
Parameters :
Returns :
Listener
|
deleteListener | ||||||||
deleteListener(props: Array
|
||||||||
This method will remove the props listenar from current axis. The Propeties Listener has certain cost and must be un-plugged when is no longer needed.
Parameters :
Returns :
void
|