Skip to content

chilipeppr-grbl/widget-grbl-xyz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

com-chilipeppr-widget-xyz

This widget shows your XYZ position. It can also show your A position. You have jog controls and axis zeroing and homing.

alt text

ChiliPeppr Widget / XYZ Axes for Grbl

All ChiliPeppr widgets/elements are defined using cpdefine() which is a method that mimics require.js. Each defined object must have a unique ID so it does not conflict with other ChiliPeppr widgets.

Item Value
ID com-chilipeppr-widget-xyz
Name Widget / XYZ Axes for Grbl
Description This widget shows your XYZ position. It can also show your A position. You have jog controls and axis zeroing and homing.
chilipeppr.load() URL http://raw.githubusercontent.com/chilipeppr-grbl/widget-grbl-xyz/master/auto-generated-widget.html
Edit URL http://ide.c9.io/chilipeppr/widget-grbl-xyz
Github URL https://github.com/chilipeppr-grbl/widget-grbl-xyz
Test URL https://preview.c9users.io/chilipeppr/widget-grbl-xyz/widget.html

Example Code for chilipeppr.load() Statement

You can use the code below as a starting point for instantiating this widget inside a workspace or from another widget. The key is that you need to load your widget inlined into a div so the DOM can parse your HTML, CSS, and Javascript. Then you use cprequire() to find your widget's Javascript and get back the instance of it.

// Inject new div to contain widget or use an existing div with an ID
$("body").append('<' + 'div id="myDivWidgetXyz"><' + '/div>');

chilipeppr.load(
  "#myDivWidgetXyz",
  "http://raw.githubusercontent.com/chilipeppr-grbl/widget-grbl-xyz/master/auto-generated-widget.html",
  function() {
    // Callback after widget loaded into #myDivWidgetXyz
    // Now use require.js to get reference to instantiated widget
    cprequire(
      ["inline:com-chilipeppr-widget-xyz"], // the id you gave your widget
      function(myObjWidgetXyz) {
        // Callback that is passed reference to the newly loaded widget
        console.log("Widget / XYZ Axes for Grbl just got loaded.", myObjWidgetXyz);
        myObjWidgetXyz.init();
      }
    );
  }
);

Publish

This widget/element publishes the following signals. These signals are owned by this widget/element and are published to all objects inside the ChiliPeppr environment that listen to them via the chilipeppr.subscribe(signal, callback) method. To better understand how ChiliPeppr's subscribe() method works see amplify.js's documentation at http://amplifyjs.com/api/pubsub/

Signal Description
(No signals defined in this widget/element)

Subscribe

This widget/element subscribes to the following signals. These signals are owned by this widget/element. Other objects inside the ChiliPeppr environment can publish to these signals via the chilipeppr.publish(signal, data) method. To better understand how ChiliPeppr's publish() method works see amplify.js's documentation at http://amplifyjs.com/api/pubsub/

Signal Description
(No signals defined in this widget/element)

Foreign Publish

This widget/element publishes to the following signals that are owned by other objects. To better understand how ChiliPeppr's subscribe() method works see amplify.js's documentation at http://amplifyjs.com/api/pubsub/

Signal Description
/com-chilipeppr-widget-xyz/com-chilipeppr-widget-serialport/sendWe publish to the serial port Gcode jog commands

Foreign Subscribe

This widget/element publishes to the following signals that are owned by other objects. To better understand how ChiliPeppr's publish() method works see amplify.js's documentation at http://amplifyjs.com/api/pubsub/

Signal Description
/com-chilipeppr-widget-xyz/com-chilipeppr-interface-cnccontroller/axesWe want XYZA axis updates.
/com-chilipeppr-widget-xyz/com-chilipeppr-interface-cnccontroller/unitsDeprecated. Not listening to this anymore. We want to know if the units changed for inch/mm.
/com-chilipeppr-widget-xyz/com-chilipeppr-interface-cnccontroller/plannerpauseWe need to know when to pause sending jog cmds.
/com-chilipeppr-widget-xyz/com-chilipeppr-interface-cnccontroller/plannerresumeWe need to know when to resume jog cmds.
/com-chilipeppr-widget-xyz/com-chilipeppr-widget-3dviewer/unitsChangedListenting to see if the 3D Viewer is telling us that the user Gcode is in a specific coordinate and then just assuming we will only be sent axes coordinate updates in that unit. Not using /com-chilipeppr-interface-cnccontroller/units anymore.

Methods / Properties

The table below shows, in order, the methods and properties inside the widget/element.

Method / Property Type Description
idstring"com-chilipeppr-widget-xyz"
urlstring"http://raw.githubusercontent.com/chilipeppr-grbl/widget-grbl-xyz/master/auto-generated-widget.html"
fiddleurlstring"http://ide.c9.io/chilipeppr/widget-grbl-xyz"
githuburlstring"https://github.com/chilipeppr-grbl/widget-grbl-xyz"
testurlstring"http://widget-grbl-xyz-chilipeppr.c9users.io/widget.html"
namestring"Widget / XYZ Axes for Grbl"
descstring"This widget shows your XYZ position. It can also show your A position. You have jog controls and axis zeroing and homing."
publishobjectPlease see docs above.
subscribeobjectPlease see docs above.
foreignPublishobjectPlease see docs above.
foreignSubscribeobjectPlease see docs above.
initfunctionfunction ()
initAs3dPrintingfunctionfunction ()
setupShowHideWcsBtnfunctionfunction ()
toggleWcsfunctionfunction (evt)
setupShowHideTouchBtnfunctionfunction ()
showHideTouchBtnfunctionfunction ()
canvasobject
elobject
ctxobject
setupTouchAreafunctionfunction ()
toggleTouchJogfunctionfunction ()
canvasResizefunctionfunction ()
drawTextfunctionfunction ()
isMouseDownboolean
mouseLastOffsetobject
onMouseDownfunctionfunction (evt)
onMouseMovefunctionfunction (evt)
onMouseUpfunctionfunction (evt)
scrollPrevobject
scrollFadeTimerobject
scrollLastPosDirstring"up"
onScrollfunctionfunction (evt)
ongoingTouchesobject
startobject
inZModeboolean
handleStartfunctionfunction (evt)
sendCtrnumber
sendMovefunctionfunction (touchid, prevpos, newpos)
sendDonefunctionfunction ()
sendMoveZfunctionfunction (touchid, prevpos, newpos)
handleMovefunctionfunction (evt)
handleEndfunctionfunction (evt)
handleCancelfunctionfunction (evt)
colorForTouchfunctionfunction (touch)
copyTouchfunctionfunction (touch)
ongoingTouchIndexByIdfunctionfunction (idToFind)
logfunctionfunction (msg)
findPosfunctionfunction (obj)
lastImageobject
fadeCanvasfunctionfunction ()
fadeCtrnumber
fadeCanvasStepfunctionfunction ()
drawCirclefunctionfunction (ctx, e)
toolbarSetupfunctionfunction ()
bodyShowSmallfunctionfunction ()
bodyShowNormalfunctionfunction ()
optionsobject
setupUiFromCookiefunctionfunction ()
saveOptionsCookiefunctionfunction ()
pauseBtnIconobject
isPausedByPlannerboolean
onPlannerPausefunctionfunction ()
onPlannerResumefunctionfunction ()
toggleInMmfunctionfunction ()
currentUnitsobject
updateUnitsFromStatusfunctionfunction (units)
axisxobject
axisyobject
axiszobject
axisaobject
axesobject
setupAxesfunctionfunction ()
updateAxesFromStatusfunctionfunction (axes)
lastValobject
updateAxisfunctionfunction (axis, val)
menuSetupfunctionfunction ()
gotoZerofunctionfunction (evt)
zeroOutAxisG28functionfunction (evt)
zeroOutAxisG92functionfunction (evt)
unzeroOutAxisG92functionfunction (evt)
homeAxisfunctionfunction (evt)
isAAxisShowingboolean
showHideAxisAfunctionfunction ()
btnSetupfunctionfunction ()
jogFocusIndicatefunctionfunction ()
jogFocusUnindicatefunctionfunction ()
isInCustomMenuboolean
customMenuSetValfunctionfunction (itemNum)
jogSetupfunctionfunction ()
jogBtnfunctionfunction (evt)
basevalnumber
accelBasevalnumber
customOrigValobject
accelBaseValHilitefunctionfunction (evt)
accelBaseValUnhilitefunctionfunction ()
changeBaseValfunctionfunction (evt)
jogfunctionfunction (direction, isFast, is100xFast, is1000xFast, is10000xFast)
initBodyfunctionfunction (evt)
toggleBodyfunctionfunction (evt)
showBodyfunctionfunction (evt)
hideBodyfunctionfunction (evt)
forkSetupfunctionfunction ()

About ChiliPeppr

ChiliPeppr is a hardware fiddle, meaning it is a website that lets you easily create a workspace to fiddle with your hardware from software. ChiliPeppr provides a Serial Port JSON Server that you run locally on your computer, or remotely on another computer, to connect to the serial port of your hardware like an Arduino or other microcontroller.

You then create a workspace at ChiliPeppr.com that connects to your hardware by starting from scratch or forking somebody else's workspace that is close to what you are after. Then you write widgets in Javascript that interact with your hardware by forking the base template widget or forking another widget that is similar to what you are trying to build.

ChiliPeppr is massively capable such that the workspaces for TinyG and Grbl CNC controllers have become full-fledged CNC machine management software used by tens of thousands.

ChiliPeppr has inspired many people in the hardware/software world to use the browser and Javascript as the foundation for interacting with hardware. The Arduino team in Italy caught wind of ChiliPeppr and now ChiliPeppr's Serial Port JSON Server is the basis for the Arduino's new web IDE. If the Arduino team is excited about building on top of ChiliPeppr, what will you build on top of it?

About

The XYZ axes widget specific to Grbl (vs for TinyG)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published