-
Notifications
You must be signed in to change notification settings - Fork 3
Application Creation
gvoysey edited this page Nov 6, 2014
·
1 revision
To add a new app named NewApp to the unlock framework, modify the following files in $REPOBASE/unlock:
-
unlock/conf.json- add a new field ,
NewApp - Add
NewAppto the list of controllers specified indashboard
- add a new field ,
-
In
unlock/controller/resource- add a
AppName-icon.jpgorAppName-icon.pngfile, 128 x 128 pixels, as the app icon.
- add a
-
unlock/__init.py__- add a new method named
appName. The parameters that are specified in this method's signature must match the ones specified in the JSON (with optional additional parameters that must have default values specified in the signature).gridspeakis a good pattern to follow. - In particular:
- create factory methods for any state models. Place the factory methods in
\unlock\state\__init.py__, and implement the bodies in a separateappName_state.pyfile in\unlock\state. - create a factory method and associated implementation for the View in
unlock\view\__init.py__and in a separateappName_view.pyfile in\unlock\view.
- create factory methods for any state models. Place the factory methods in
- return the bare icon filename as the
icon=parameter ofreturn self.controller_factory.create_controller_chain()at the end of theappnamemethod inunlock\__init__.py
- add a new method named
This is sufficient for a "bare-bones" app. To add more functionality requires touching more of the code base. For example, a new decoder would be implemented in unlock\bci\decode , etc...