synman / Octoprint-Bettergrblsupport

Better Grbl Support Plugin for Octoprint based (loosely) on the original Grbl Support plugin developed by mic159
https://github.com/synman/Octoprint-Bettergrblsupport/wiki
64 stars 19 forks source link

basic A and B rotational support #107

Closed paukstelis closed 1 year ago

paukstelis commented 1 year ago

Basic functionality for A and B axes. Settings enable jog and status. Messages may need another couple of conditions (A, no B; B, no A) but maybe there is a more clever way to do it.

synman commented 1 year ago

I'm out of town for a couple days. Will get on this once back home mid next week.

synman commented 1 year ago

I'm going to merge this and clean up the .vscode stuff

paukstelis commented 1 year ago

Weird, it should have been in .gitignore...

synman commented 1 year ago

nbd... looks like I've got some post merge cleanup to do. my devel machine is not happy.

Screenshot 2023-01-05 at 7 55 27 PM
synman commented 1 year ago

Error instantiating bettergrblsupportViewModel : TypeError: self.settings.hasA is not a function at new BettergrblsupportViewModel (http://octopi-laser/static/webassets/packed_plugins.js?1b3c85b6:430:35) at _createViewModelInstance (http://octopi-laser/static/webassets/packed_core.js?d44a1aa2:1117:213) at HTMLDocument. (http://octopi-laser/static/webassets/packed_core.js?d44a1aa2:1121:45) at e (http://octopi-laser/static/webassets/packed_libs.js?7111420c:13:30005) at t (http://octopi-laser/static/webassets/packed_libs.js?7111420c:13:30307) (anonymous) @ packed_core.js?d44a1aa2:1122 packed_core.js?d44a1aa2:1131

synman commented 1 year ago

weird.. this may be an nfs sync issue on my end.

paukstelis commented 1 year ago

That was stuff I was messing with after PR submission. I did not realize that would get pulled along. I was trying to figure out how to add the origin_axes conditionally based on the settings.

synman commented 1 year ago

I'll take care of this... but yeah, everything you do in the PR branch amends the PR. I'm still not sure we have an actual problem. I see these settings defined in init.py

synman commented 1 year ago

ah... yeah, it's broke.

should be:

self.settings.settings.plugins.bettergrblsupport.hasA and self.settings.settings.plugins.bettergrblsupport.hasB

paukstelis commented 1 year ago

ah... yeah, it's broke.

should be:

self.settings.settings.plugins.bettergrblsupport.hasA and self.settings.settings.plugins.bettergrblsupport.hasB

I tried that, still didn't work for me.

synman commented 1 year ago

it's because the view model isn't fully built in its constructor. settings gets wired up right before onBeforeBinding.

All better now. I have no way to test this as I don't have 5 axes machine, but it's binding properly now.

https://github.com/synman/Octoprint-Bettergrblsupport/commit/41640fe3aa538133aec696e0789b85dee7b65586

synman commented 1 year ago

ok, maybe I can test a little. I love the look here

Screenshot 2023-01-05 at 8 13 32 PM
synman commented 1 year ago
Screenshot 2023-01-05 at 8 16 26 PM

I think we can do this a little more cleanly. Pretty sure there is a way to push within a list in js. I'm even tempted to push them to index 0... that way they'd show up before Z.

synman commented 1 year ago

hmm... do we even need them? It doesn't look like they are tied to setting or traveling to an origin. Selecting "A" and hitting home, generated the following GCODE:

Send: G0 G90 X0 Y0 Z0

I half expected to see "G0 G90 A0"

you can find this logic here: https://github.com/synman/Octoprint-Bettergrblsupport/blob/devel/octoprint_bettergrblsupport/__init__.py#L1341

synman commented 1 year ago

It gets set on the other side here: https://github.com/synman/Octoprint-Bettergrblsupport/blob/devel/octoprint_bettergrblsupport/__init__.py#L1425

paukstelis commented 1 year ago

hmm... do we even need them? It doesn't look like they are tied to setting or traveling to an origin. Selecting "A" and hitting home, generated the following GCODE:

Send: G0 G90 X0 Y0 Z0

I half expected to see "G0 G90 A0"

you can find this logic here: https://github.com/synman/Octoprint-Bettergrblsupport/blob/devel/octoprint_bettergrblsupport/__init__.py#L1341

I debated if it was necessary, but I think it would be useful for zeroing work space coordinates for all axes with a single click.

synman commented 1 year ago

Once you have it squared away, feel free to submit another PR. Let's get A/B cleaned up in the axes bar too. I think they'll look best to the left of Z.