Aha! Yes. Sample prefs at the bottom & attached
The hardware parameterization in prefs has two levels: a "group" (eg. FLAGS, LEDS) and then a "name" - an LED named "C" for a center LED. The "group" part is intended to be flexible, because, for example, a task might want to turn all LEDs in the nosepoke off after a trial ends, but there might be an additional LED that's being used as an arena light that we don't want to turn off -- we still want to be able to write a method that iterates through hardware['LEDS'] but not *all* the LEDs in the system. The name of the hardware type is used by default when first instantiating.
So the 'group' tags are intended to be edited to match the requirements of a task -- the task says it needs 3 solenoids in the 'PORTS' group, so eg. if one was replicating someone else's experiments you would configure your solenoids however they needed to be and put them in that group.
The automatic generation of hardware prefs is relatively new (in early summer?) and I haven't been in the lab doing extensive testing during that time, so haven't had much time to sculpt that process -- prefs is sort of intended to be worked on as text, but I do also want to expose that to the GUI once that code gets refactored.
It's a design tradeoff that I think still could be made more elegant -- and especially could do with some better documentation (opened an issue to keep track of that here:
https://github.com/wehr-lab/autopilot/issues/38 . I could also see a 'group' being an attribute or parameter and having the prefs structure being more uniform/predictable by having parts nested under their class name (as is default), which would sort of imply also flattening out the 'name' nesting level. Benefits to both I think.
{
"AGENT": "PILOT",
"AUDIOSERVER": true,
"BASEDIR": "/home/pi/autopilot",
"CHILDID": "",
"CONFIG": "",
"DATADIR": "/home/pi/autopilot/data",
"FS": 192000,
"HARDWARE": {
"FLAGS": {
"L": "",
"R": ""
},
"LASERS": {
"LR": {
"name": "LASER_LR",
"pin": 36
}
},
"LEDS": {
"C": {
"pins": [
22,
18,
16
],
"polarity": 0
},
"L": {
"pins": [
11,
13,
15
],
"polarity": 0
},
"R": {
"pins": [
19,
21,
23
],
"polarity": 0
},
"TOP": {
"name": "LED_TOP",
"pin": 32
}
},
"POKES": {
"C": {
"pin": 8,
"polarity": 0
},
"L": {
"pin": 24,
"polarity": 0
},
"R": {
"pin": 10,
"polarity": 0
}
},
"PORTS": {
"C": 33,
"L": 31,
"R": 37
}
},
"JACKDSTRING": "jackd -P75 -p16 -t2000 -dalsa -dhw:sndrpihifiberry -P -rfs -n3 -s &",
"LINEAGE": "NONE",
"LOGDIR": "/home/pi/autopilot/logs",
"LOGLEVEL": "DEBUG",
"MSGPORT": 5565,
"NAME": "pilot_2",
"NCHANNELS": 1,
"OUTCHANNELS": [
1
],
"PARENTID": "",
"PARENTIP": "",
"PARENTPORT": "",
"PIGPIOARGS": "-t 0 -l",
"PIGPIOMASK": 1111110000111111111111110000,
"PROTOCOLDIR": "/home/pi/autopilot/protocols",
"PULLDOWNS": "",
"PULLUPS": [
7
],
"PUSHPORT": 5560,
"REPODIR": "/home/pi/git/autopilot",
"SOUNDDIR": "/home/pi/autopilot/sounds",
"TERMINALIP": "192.168.0.100",
"VENV": "/home/pi/git/autopilot/venv",
"VIZDIR": "/home/pi/autopilot/viz"
}