forked from farshield/shortcircuit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Getting player location from GUI working
- Loading branch information
Valtyr Farshield
committed
Feb 29, 2016
1 parent
37607c6
commit aeaa594
Showing
8 changed files
with
105 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# crestprocessor.py | ||
|
||
import threading | ||
from PySide import QtCore | ||
from crest.crest import Crest | ||
|
||
|
||
class CrestProcessor(QtCore.QObject): | ||
""" | ||
CREST Middle-ware | ||
""" | ||
login_response = QtCore.Signal(str) | ||
location_response = QtCore.Signal(str) | ||
destination_response = QtCore.Signal(bool) | ||
|
||
def __init__(self, parent=None): | ||
super(CrestProcessor, self).__init__(parent) | ||
self.crest = Crest(self._login_callback) | ||
|
||
def login(self): | ||
return self.crest.start_server() | ||
|
||
def logout(self): | ||
self.crest.logout() | ||
|
||
def get_location(self): | ||
server_thread = threading.Thread(target=self._get_location) | ||
server_thread.setDaemon(True) | ||
server_thread.start() | ||
|
||
def _get_location(self): | ||
location = self.crest.get_char_location() | ||
self.location_response.emit(location) | ||
|
||
def _login_callback(self, char_name): | ||
self.login_response.emit(char_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters