cncjs / cncjs-pendant-tinyweb

A tiny web console for small 320x240 LCD display
https://cncjs.github.io/cncjs-pendant-tinyweb/src/
MIT License
26 stars 25 forks source link

Play Button #1

Closed nkings10 closed 7 years ago

nkings10 commented 7 years ago

Not really an issue but i was wondering how it would be possible to get the Play button to start the job.

I have customised my pendant with functions i use to setup my machine.

screenshot_20170514-204641

My workflow is to upload the file via the full web interface.

Then on the pendant: Unlock and Home (if the machine has been off). Press "Clamp" which send the machine to the back center which gives me room to clamp. Insert the material. Press Tool which brings the spindle to the front centre. Manually change the tool Move it within 10mm from the touch plate. Press Probe Move the tool to the front left and press Zero which does X and Y only.

Then go back to the full web interface and press start.

Currently i only seem to be able to start the job via the full web interface but would like to be able to press start from the pendant. But it does not seem to work.

Any help would be appreciated.

Thanks.

cheton commented 7 years ago

In your index.html, change the onclick event of "play" and "pause" buttons with different controller commands, as shown below:

<div class="col-xs-2">
    <button type="button" class="btn btn-default" onclick="cnc.controller.command('start')">
        <i class="fa fa-play"></i>
    </button>
</div>
<div class="col-xs-2">
    <button type="button" class="btn btn-default" onclick="cnc.controller.command('pause')">
        <i class="fa fa-pause"></i>
    </button>
</div>

You can add more commands with respect to your needs, for example, 'start', 'pause', 'resume', 'stop', 'feedhold', 'cyclestart', and etc. The full commands can be found in the GrblController.js file: https://github.com/cncjs/cncjs/blob/master/src/app/controllers/Grbl/GrblController.js#L746\

nkings10 commented 7 years ago

Perfect, thank-you, good to know where the commands are too. Just didn't know what to change it too.