phrack / ShootOFF-legacy

An open source framework to enhance laser dry fire training.
BSD 4-Clause "Original" or "Old" License
30 stars 17 forks source link

made a few minor changes #58

Closed flynnguy closed 10 years ago

flynnguy commented 10 years ago

So while waiting for my laser to come in the mail, I figured I'd try getting this up and running on my MacBook Pro. I encountered a few issues since I'm running OS 10.9 and I guess the original instructions were for a previous version. I'm still getting 'Segmentation fault: 11' but with the minor changes I made below I was able to execute the commands in the main python block in shootoff.py to get the window to launch. I'm not sure if the laser detection works yet or not but I'll try that soon.

I also made a few minor pep8 changes. There's more I can do to clean it up but I didn't want to come in and change everything around yet. I'm still getting some errors which I'll paste below in case you have any ideas because they don't look limited to OS X. If not I'll probably tinker around with it some more. Thanks.

Here is the remaining error I am getting: In [3]: MainWindow(config) 2013-12-16 13:16:50,484 - shootoff - INFO - Couldn't get webcam FPS, defaulting to 30. Out[3]: <shootoff.MainWindow instance at 0x1116b1680>

In [4]: Exception in thread shot_detection_thread: Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in bootstrap_inner self.run() File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 761, in run self.__target(_self.args, *_self.__kwargs) File "shootoff.py", line 109, in detect_shots self.detect_shots) File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 537, in after name = self._register(callit) File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1158, in _register self.tk.createcommand(name, f) RuntimeError: main thread is not in main loop

Exception in thread refresh_thread: Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in bootstrap_inner self.run() File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 761, in run self.__target(_self.args, *_self.__kwargs) File "shootoff.py", line 52, in refresh_frame self._window.after(FEED_FPS, self.refresh_frame) File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 537, in after name = self._register(callit) File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1158, in _register self.tk.createcommand(name, f) RuntimeError: main thread is not in main loop

phrack commented 10 years ago

Awesome, thanks! I merged this a tweaked a few things (e.g. the configurator was making a new logger every time get_logger was called, which caused all logged messages to be duplicated).

The testers and I have not been able to find any new bugs on Windows or Linux, so I am tagging master as 1.3 and releasing. Mac in general has been neglected. The only people that I know for a fact are using it on Mac are people like yourself that are comfortable writing code. It would be really cool if you or another programmer that uses Macs could stabilize it on Mac and create a package:

https://github.com/phrack/ShootOFF/wiki/Making-a-ShootOFF-Package