gerritv / Grbl-Panel

A control panel for Grbl
MIT License
180 stars 103 forks source link

Added IP Connection #13

Closed tylerv closed 9 years ago

tylerv commented 9 years ago

@gerritv Thanks for making Grbl-Panel. Here's my unsophisticated attempt at adding a feature, if you have any suggestions for improvement, please let me know. Programming is a seldom used hobby of mine, I'm by no means an expert.

Added the option to connect to an IP address and port for those who have added a WiFi option to their CNC machine, e.g. with a WiFly, as here: http://www.shapeoko.com/blog/archives/1272

I basically renamed grblIF to grblCOM, then copied it and renamed/updated to grblIP. Most functions work the same except for the data received method, which runs in it's own thread (I think) and constantly processes incoming data as long as the TCPClient is connected. I also updated any "sendData" functions I found to send the data to the right connection (COM or IP) based on which one is connected.

Please let me know if you have any questions. I'm pretty new on actually using GitHub to work on projects.

Thanks, --TylerV.

gerritv commented 9 years ago

Hi Tyler I am in the process of rebuilding my development server so it might be a week before I get to merge this. I will probably refactor your code into a less duplicative approach, but attain the same result. Plus I need to learn how to work with pulls etc on Git, not intuitive to a CVS/SVN guy :-)

Thank you for the kudos and the code.

Just in general: Generally with Visual Studio there are a whole bunch of files not checked in, e.g. .suo, bin/ obj/ vs.... stuff etc.

gerritv commented 9 years ago

@tylerv Now that I have resolved a bunch of other enhancement and fix requests, I will be looking at your enhancement. It will take a bit of time to unravel your changes into a more generic solution but you have done the hard part for me, namely figuring out how to get it working.

FYI, nothing in the obj or bin directories should be added to Git.

tylerv commented 9 years ago

@gerritv Cool, glad to hear. I was working on it a little more the other day and merged the IP connection back into the COM class, if helps make anything easier. I did a commit of that code later ("Simplified Connection") so it may not be in the pull request (I'm still figuring Github out).

I'll check out how to exclude those directories, thanks for the heads up.

EDIT: Turns out the "Close and Comment" button wasn't the one I wanted...

gerritv commented 9 years ago

I'll take a look at your directory, i am not thrilled with Git at present.

tylerv commented 9 years ago

I think I got my directory cleaned up. Now that I removed the unwanted files from Github, my .gitignore file is working and preventing the new VS temp files from getting uploaded.

I'll stop messing with stuff for a while. Sorry for all the commits in a row.

gerritv commented 9 years ago

"I'll stop messing with stuff for a while. Sorry for all the commits in a row." it is called iterative development :-) I use VisualSVN as a server at home, and commit many times per day. A lesson learned the hard way many many years ago.

I should add the .gitgnore to my repository.

tbfleming commented 9 years ago

Just a bit of a Git warning: treat this fork as corrupt. If you pull from it then you'll include the junk file (obj) content addition and deletion, increasing the size of the main repository. This will impact every who clones it. Git takes some getting used to.

tylerv commented 9 years ago

Thanks for the heads up. Gerrit mentioned this to me already and those junk files should be gone in later commits. If there's anything else that should not be on Git, please let me know.

Thanks

tbfleming commented 9 years ago

Unfortunately later commits can't fix it; it's a permanent part of the history. The easiest way to fix it is to create a new fork.

It's easier to determine which files to include instead of trying to figure out which ones to exclude. Start by only including files you know are necessary (e.g. source files). Commit. Clone your repository to a different directory then open the project, build, and run. Visual Studio will let you know if any files are missing; add them, commit, and repeat.

gerritv commented 9 years ago

It is possible to delete files from Github, one file at a time.

tbfleming commented 9 years ago

Yes, but that's versioned. It still holds the bad files as part of the history, which still gets merged. When you clone, the clone includes all the deleted file content in a hidden area.

gerritv commented 9 years ago

Hi Tyler The code you provided is finally included in V1.0.3.0, See Releases tab above.

Can you cancel the Pull request? I used your github repository directly after your refactoring work. I did some more refactoring as well.

I couldn't directly test the IP connectivity beyond connecting to a local web server. It replied with the expected errors but GrblPanel did connect and receive data in return.

tylerv commented 9 years ago

Awesome, I'll test it when I get my CNC up and running again.

Thanks!