Difference between revisions of "Plugins"

From Bcontrol
(What Plugins are available?)
(What Plugins are available?)
Line 11: Line 11:
  
 
== What Plugins are available? ==
 
== What Plugins are available? ==
* saveload: Load/Save settings/data
 
* water: Water Valve Calibrator and look-up table for dispense times
 
* sessionmodel: Session Automation
 
* soundmanager: (SP: not sure what this does) Allows playing of sound on virtual setups?
 
  
 
{| border="1" cellpadding="4" cellspacing="2"
 
{| border="1" cellpadding="4" cellspacing="2"
! Plugin class || Main method (what you call in your protocol)
+
! Plugin class<br>(what you inherit from in your 'class' statement) || What it does || Main method<br>(what you call in your protocol)
 
|-
 
|-
| @saveload || SavingSection  
+
| @saveload || Load/Save Settings/Data files || SavingSection  
 
|-  
 
|-  
| @sessionmodel || SessionDefinition
+
| @sessionmodel || Session Automation || SessionDefinition
 +
|-
 +
| @soundmanager || (SP: Not sure what this does) Allows playing of protocol-related sounds on virtual setups? || ?
 +
|-
 +
| @water || Water valve calibrator and look-up table for dispense times || ?
 
|}
 
|}
  

Revision as of 16:54, 17 June 2007

This page will (eventually) tell you how to set up a plugin. Right now, it contains ad-hoc comments.

What are Plugins and when would I use them?

A plugin is a piece of code that provides generic functionality useful to a host of training protocols. Examples are:

  • Graphically seeing state progression and interaction with pokes on a trial-by-trial basis (like the graph on the top-left side of this page).
  • Play sounds on a virtual state machine (useful when debugging your code on a laptop, as opposed to on a behaviour box)
  • Automating training sessions so that Solo changes parameter values based on animal performance, removing the need for manual intervention.

What Plugins are available?

Plugin class
(what you inherit from in your 'class' statement)
What it does Main method
(what you call in your protocol)
@saveload Load/Save Settings/Data files SavingSection
@sessionmodel Session Automation SessionDefinition
@soundmanager (SP: Not sure what this does) Allows playing of protocol-related sounds on virtual setups? ?
@water Water valve calibrator and look-up table for dispense times ?

How to start using a Plugin

  • In the constructor of your protocol, inherit from all the plugins you want to use.
    For example, if you want to use 'saveload' and 'water', you would inherit from these Plugins are part of your 'class' statement.
         obj = class(obj, mfilename, saveload, water);
  • Call the method of the plugin that does the work. (for example, for Plugin 'saveload', this would be 'SavingSection').
        [x, y] = SavingSection(obj, 'init', x, y);