Hi everyone. I was wondering if there was any compelling reason to not have a “local file picker” interface for selecting gcode files. I saw that there were a few posts about it scattered around the place, and figured that before I go and implement something, that I should ask as to why it hasnt already been done. It seems to be the only thing prohibiting chilipeppr from working entirely in kiosk mode.
It was never done just because dragging/dropping files into the browser works so well that the file dialog box picking method seemed sub-par. However, if you’re trying to do a kiosk mode then yes, it would totally make sense. My suggestion would be to fork the pulldown menu that shows your recent files and maybe change that up to have an “Open…” command that would then popup your dialog box and then mimic the opening of the file based on how the drag/drop works.
You should be able to just do a pull request to me on Github and I’ll publish the changes.
@jlauer that’s exactly what I was planning to do. Thanks for the feedback!
BTW, there is a sample macro that shows you how to load a Gcode file. You may have already seen it or figured it out. Here’s the code from that macro
var gcodetxt = “(This is my gcode)\nG92\nG0 Z1\nG1 X10\nY10\nX0\nY0\n”;
var info = {
name: “My gcode file”,
lastModified: new Date()
};
// send event off as if the file was drag/dropped
chilipeppr.publish("/com-chilipeppr-elem-dragdrop/ondropped", gcodetxt, info);
@jlauer thx
Just issued a pull request. I normally don’t just push things up so quickly without fully testing, but there is a lot I need to get up to speed with in regards to c9, github and the chilipeppr framework
Published it. It’s working great inside TinyG workspace. It should be showing in other workspaces too since they all use the same widget. Nice work @Daniel_Chote . Simple feature addition, but well-needed. We all thank you for the contribution.
@jlauer fantastic. Absolutely love the pubsub system. I have a feeling I’m going to be doing a LOT of chilipeppr hacking in the near future!
I agree that the pubsub system is good. It has allowed ChiliPeppr to scale as independent widgets that can all still talk to each other. For example, if you want to write a widget or macro that interacts with the 3D viewer, you can just use pubsub to inject your 3D objects.
Yeah would be handy, I was running jobs off my android phone last week as I had no dsl internet or off line copy. Managed to do it by copy and paste the gcode in. Got to love getting out of a tight spot using what you have available.