LaserWeb / deprecated-LaserWeb3

Open Source Laser Cutter / Engraver software. Supports gcode, svg, dxf, stl, png, jpg, bmp
266 stars 68 forks source link

Add indicator while processing trace from vector #122

Closed cojarbi closed 8 years ago

cojarbi commented 8 years ago

Currently there is not indication that there an ongoing process. For large or complex images trace and take some time. Maybe add the same indicator as raster

krolco commented 8 years ago

I just added #125 for this. Give it a whirl.

cojarbi commented 8 years ago

I do see that something its going on as now the screen goes darker, but the message comes and goes to fast. Try it with the attached image.

If you can please use the same loading indicator as the raster process. Besides not being intrusive it also lets you do some other stuff in the screen

moon_large

ghost commented 8 years ago

http://ricostacruz.com/nprogress/ .start, .inc, and done should do...

On Sep 9, 2016 9:46 PM, "Ariel Yahni" notifications@github.com wrote:

I do see that something its going on as now the screen goes darker, but the message comes and goes to fast. Try it with the attached image.

If you can please use the same loading indicator as the raster process. Besides not being intrusive it also lets you do some other stuff in the screen

[image: moon_large] https://cloud.githubusercontent.com/assets/16444438/18400544/0457000e-769c-11e6-9160-ac5d54f704cf.jpg

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openhardwarecoza/LaserWeb3/issues/122#issuecomment-246019344, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVr220a07ekU2R2g_Adio4gu0-ISfqTks5qobeBgaJpZM4J4nXE .

krolco commented 8 years ago

Ah, I didn't notice that there was an existing progress indicator for the UI. I'll change over to that

krolco commented 8 years ago

@openhardwarecoza So, Potrace doesn't seems to fire any progress events, so I don't think anything will call .inc at all, but that's OK, because nprogress fakes progress automatically :) I'm working on this one; I'm out of town for a bit, but I'll get it.

krolco commented 8 years ago

Messed with this some more... Potrace runs the Javascript thread at 100% while it's tracing, and it seems that no progress events fire, even when I put it on a dedicated timer, and even when I stuck an .inc() call directly in Potrace. I'll have to work on this one more.

krolco commented 8 years ago

So I'm stuck on this simple request; the JS just wedges up tight while Potrace is running, and I don't get any motion of the bar. I'm tabling this for a bit until I think of something else.

ghost commented 8 years ago

We may need to rewrite the potrace library to work in chunks like I did here https://github.com/openhardwarecoza/LaserWeb/commit/41ee83ed3e7124e4cf346e2cf78de991648e818d#diff-681a90cbc63da7ac6566acc75887b718R203

that doChunk function takes what would normally be a loop, and does it in chunks instead - each chunk ties up the browser for maxTimePerChunk, after which it releases, we can then do a GUI update like nprogress, and then it takes the next chunk for processing...

ghost commented 8 years ago

https://github.com/openhardwarecoza/LaserWeb3/blob/74feb7fe91b1084f7062b398a309f3792f3fa2e1/public/lib/gcode-viewer/gcode-parser.js#L168 also uses doChunk

krolco commented 8 years ago

Oh boy... I'll have to spend some time to grok that one. For now, I did change it over to NProgress, although it doesn't update much if at all while Potrace is running. It's at least consistent with raster generation now, though.

ghost commented 8 years ago

Closing this for now...