-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated documentation and implemented bpodgui plugin
- Loading branch information
1 parent
beab44b
commit 712133c
Showing
10 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Empty file.
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 @@ | ||
from pybpod_rotaryencoder_module.models.projects.projects_rotaryencoder import ProjectsRotaryEncoder as Projects |
34 changes: 34 additions & 0 deletions
34
pybpod_rotaryencoder_module/models/projects/projects_rotaryencoder.py
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,34 @@ | ||
# !/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
from pysettings import conf | ||
if conf.PYFORMS_USE_QT5: | ||
from PyQt5.QtGui import QIcon | ||
else: | ||
from PyQt4.QtGui import QIcon | ||
|
||
from pybpod_rotaryencoder_module.module_gui import RotaryEncoderModuleGUI | ||
|
||
class ProjectsRotaryEncoder(object): | ||
|
||
def register_on_main_menu(self, mainmenu): | ||
super(ProjectsRotaryEncoder, self).register_on_main_menu(mainmenu) | ||
|
||
if len([m for m in mainmenu if 'Tools' in m.keys()]) == 0: | ||
mainmenu.append({'Tools': []}) | ||
|
||
menu_index = 0 | ||
for i, m in enumerate(mainmenu): | ||
if 'Tools' in m.keys(): menu_index=i; break | ||
|
||
mainmenu[menu_index]['Tools'].append( '-' ) | ||
mainmenu[menu_index]['Tools'].append( {'Rotary encoder': self.open_rotaryencoder_plugin, 'icon': QIcon(conf.ROTARYENCODER_PLUGIN_ICON)} ) | ||
|
||
def open_rotaryencoder_plugin(self): | ||
if not hasattr(self, 'rotaryencoder_plugin'): | ||
self.rotaryencoder_plugin = RotaryEncoderModuleGUI(self) | ||
self.rotaryencoder_plugin.show() | ||
self.rotaryencoder_plugin.subwindow.resize(*conf.ROTARYENCODER_PLUGIN_WINDOW_SIZE) | ||
else: | ||
self.rotaryencoder_plugin.show() | ||
|
||
return self.rotaryencoder_plugin |
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,11 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
|
||
|
||
ROTARYENCODER_PLUGIN_ICON = os.path.join( os.path.dirname(__file__), 'resources', 'rotary.png' ) | ||
|
||
|
||
ROTARYENCODER_PLUGIN_WINDOW_SIZE = 300, 500 | ||
|
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