You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><strong>Bottom timeline</strong> — your experiment sequence. Green = conditions, gray = phases (PRE/POST), dark = inter-trial intervals (ITI). Click any block to edit it.</li>
240
243
</ul>
241
244
242
245
<h2>Walkthrough: create an optomotor protocol</h2>
243
246
244
-
<p>We will build a simple experiment with 3 stimulus conditions, 3 repetitions, randomized, with inter-trial intervals.</p>
247
+
<p>We will build an experiment with 3 stimulus conditions, backlight and camera plugins, 3 repetitions, randomized, with inter-trial intervals.</p>
245
248
246
249
<divclass="step">
247
250
<spanclass="step-number">1</span>
@@ -253,17 +256,17 @@ <h2>Walkthrough: create an optomotor protocol</h2>
<pclass="hint">The arena dropdown sets the visual preview. The rig path is written to the v2 YAML for MATLAB to resolve the full hardware configuration.</p>
259
263
</div>
260
264
261
265
<divclass="step">
262
266
<spanclass="step-number">3</span>
263
267
<p><strong>Set repetitions and randomization</strong> (left panel, Structure section)</p>
264
268
<p>Repetitions: <code>3</code></p>
265
269
<p>Check <strong>Randomize order</strong></p>
266
-
<pclass="hint">The summary bar on the timeline updates to show total trials and duration.</p>
267
270
</div>
268
271
269
272
<divclass="step">
@@ -275,70 +278,93 @@ <h2>Walkthrough: create an optomotor protocol</h2>
275
278
276
279
<divclass="step">
277
280
<spanclass="step-number">5</span>
278
-
<p><strong>Edit the first condition</strong> (right panel)</p>
279
-
<p>The first condition is auto-selected on page load. In the right panel:</p>
<p>Leave <strong>Pattern File empty</strong> — this generates an <code>allOff</code> command in the YAML</p>
302
-
<p>Duration: <code>3</code> seconds</p>
298
+
<p><strong>Add plugin commands to the condition</strong></p>
299
+
<p>Use the <strong>+ Add Command...</strong> dropdown at the bottom of the card list:</p>
300
+
<p>Select <code>Get Timestamp</code> from the BIAS Camera group — a blue plugin card appears</p>
301
+
<p>Select <code>Wait</code> — a gray wait card appears (set duration to <code>3</code>)</p>
302
+
<p>Select <code>Set IR LED Power</code> from the LED Backlight group — set power to <code>50</code></p>
303
+
<pclass="hint">Commands execute sequentially. trialParams fires the arena controller autonomously; plugin and wait commands run during the display period.</p>
303
304
</div>
304
305
305
306
<divclass="step">
306
307
<spanclass="step-number">8</span>
307
-
<p><strong>Configure the pretrial phase</strong></p>
308
-
<p>Click the gray <strong>PRE</strong> block on the timeline.</p>
<p>Click <strong>+ Add Condition</strong> in the timeline toolbar. Repeat for a third.</p>
310
+
<p>Set IDs like <code>leftward_grating</code> and <code>dark_control</code>. For the dark control, leave Pattern empty to generate an <code>allOff</code> command.</p>
311
311
</div>
312
312
313
313
<divclass="step">
314
314
<spanclass="step-number">9</span>
315
-
<p><strong>Configure the inter-trial interval</strong></p>
316
-
<p>Click any dark <strong>ITI</strong> block on the timeline.</p>
<p>Click the gray <strong>PRE</strong> block. The phase editor shows command cards just like conditions.</p>
317
+
<p>The default is <code>allOff</code> + <code>wait 0.5s</code>. Use the Add Command dropdown to add plugin commands (e.g., <code>Start Recording</code> from BIAS Camera).</p>
<p>Drag any green condition block and drop it onto another to swap positions.</p>
322
+
<p><strong>Review in Table view</strong></p>
323
+
<p>Click the <strong>TABLE</strong> tab to see all commands across all sections as a spreadsheet.</p>
324
+
<p>Collapsible sections show Pretrial, each Condition, Intertrial, and Posttrial with their command lists.</p>
325
+
<pclass="hint">Type badges are color-coded: green = controller, gray = wait, blue = plugin.</p>
325
326
</div>
326
327
327
328
<divclass="step">
328
329
<spanclass="step-number">11</span>
330
+
<p><strong>Visualize with Timeline view</strong></p>
331
+
<p>Click the <strong>TIMELINE</strong> tab, then click a condition on the bottom timeline.</p>
332
+
<p>The SVG shows concurrent lanes: controller bar (green), plugin markers (blue dots), and wait bars (gray).</p>
333
+
<pclass="hint">This shows how trialParams runs autonomously while plugin commands execute at their sequential time positions. Hover over elements for tooltips.</p>
334
+
</div>
335
+
336
+
<divclass="step">
337
+
<spanclass="step-number">12</span>
329
338
<p><strong>Export your protocol</strong></p>
330
339
<p>Click <strong>Export YAML</strong> (or press <code>Ctrl+E</code>). A <code>.yaml</code> file downloads.</p>
331
-
<pclass="hint">The file is a valid protocol v1 YAML ready for MATLAB execution.</p>
340
+
<pclass="hint">The file is a valid protocol v2 YAML with rig reference, plugins, and multi-command conditions — ready for MATLAB execution.</p>
332
341
</div>
333
342
334
343
<h2>Importing an existing protocol</h2>
335
344
336
-
<p>Click <strong>Import YAML</strong> in the top bar and select any protocol v1 <code>.yaml</code> file. The editor populates with all settings, conditions, and phases from the file. You can then modify and re-export.</p>
345
+
<p>Click <strong>Import YAML</strong> in the top bar and select any v2 protocol <code>.yaml</code> file. The editor populates with all settings, conditions, plugins, and phases. You can modify and re-export.</p>
337
346
338
347
<divclass="tip-box">
339
-
<strong>Try it now:</strong>Download the example file <ahref="examples/simple_optomotor_protocol.yaml">simple_optomotor_protocol.yaml</a> and import it into the designer to see the walkthrough above pre-filled.
348
+
<strong>Try it:</strong>Import one of the example protocols from the maDisplayTools repository, such as <code>full_experiment_test.yaml</code> (9 conditions with camera + backlight plugins) to see a fully populated experiment.
340
349
</div>
341
350
351
+
<h2>Editor tabs</h2>
352
+
353
+
<h3>Visual tab</h3>
354
+
<p>The default editor. Each command is a color-coded card with inline editable fields. Cards have colored left borders: <strongstyle="color: #00e676;">green</strong> = controller, <strongstyle="color: #8b949e;">gray</strong> = wait, <strongstyle="color: #4dabf7;">blue</strong> = plugin. Use the <code>+ Add Command...</code> dropdown to add new commands. Click <strong>×</strong> to delete a command.</p>
355
+
356
+
<h3>Table tab</h3>
357
+
<p>Shows the entire experiment as a spreadsheet with collapsible sections. Each row is one command with columns for Type, Target (plugin name), Command, Duration, Mode, Frame Rate, and Pattern/Params. Click section headers to collapse/expand.</p>
358
+
359
+
<h3>Timeline tab</h3>
360
+
<p>SVG multi-lane visualization of the selected condition. Shows how commands execute concurrently:</p>
361
+
<ulclass="key-list">
362
+
<li><strong>Controller lane</strong> — green bar spanning the trialParams duration</li>
363
+
<li><strong>Plugin lanes</strong> — blue circle markers at each plugin command's execution time</li>
<pclass="hint">Key insight: <code>trialParams</code> fires the arena controller which runs autonomously for its duration. Wait commands advance the clock. Plugin commands fire at the current clock position without advancing it.</p>
367
+
342
368
<h2>Timeline controls</h2>
343
369
344
370
<ulclass="key-list">
@@ -358,19 +384,35 @@ <h2>Keyboard shortcuts</h2>
358
384
359
385
<h2>Key concepts</h2>
360
386
387
+
<h3>Protocol v2</h3>
388
+
<p>The designer exports <strong>YAML protocol v2</strong>. Key differences from v1: a <code>rig:</code> reference replaces inline <code>arena_info:</code>, a <code>plugins:</code> section defines hardware plugins, and conditions use <strong>command arrays</strong> (multiple commands per condition, not just one trialParams).</p>
389
+
361
390
<h3>Conditions vs. Trials</h3>
362
-
<p>You define <strong>conditions</strong> (unique stimulus configurations). The experiment runs each condition × repetitions, optionally in random order. The actual sequence of <strong>trials</strong> is shown in the summary bar.</p>
391
+
<p>You define <strong>conditions</strong> (unique stimulus + plugin configurations). The experiment runs each condition × repetitions, optionally in random order. The actual sequence of <strong>trials</strong> is shown in the summary bar.</p>
392
+
393
+
<h3>Commands</h3>
394
+
<p>Each condition and phase contains a sequence of <strong>commands</strong>:</p>
<li><strong>wait</strong> — pause execution for a specified duration</li>
398
+
<li><strong>plugin</strong> — send a command to an enabled plugin (e.g., <code>camera.getTimestamp</code>, <code>backlight.setRedLEDPower</code>)</li>
399
+
</ul>
400
+
401
+
<h3>Plugins</h3>
402
+
<p><strong>LED Backlight</strong> (LEDControllerPlugin): control IR and visible LEDs behind arena panels. Commands: setIRLEDPower, setRedLEDPower, setGreenLEDPower, setBlueLEDPower, turnOnLED, turnOffLED, setVisibleBacklightsOff.</p>
403
+
<p><strong>BIAS Camera</strong> (BiasPlugin): video recording and timestamps. Commands: startRecording, stopRecording, startPreview, stopCapture, getTimestamp, disconnect.</p>
404
+
<pclass="hint">Enable plugins in the left panel to make their commands available in the Add Command dropdown.</p>
363
405
364
406
<h3>Phases</h3>
365
-
<p><strong>Pretrial</strong> runs once before all trials. <strong>Intertrial</strong> runs between every trial. <strong>Posttrial</strong> runs once after all trials complete. Each phase has one pattern command + an optional wait.</p>
407
+
<p><strong>Pretrial</strong> runs once before all trials. <strong>Intertrial</strong> runs between every trial. <strong>Posttrial</strong> runs once after all trials complete. Each phase can contain any combination of controller, wait, and plugin commands.</p>
366
408
367
409
<h3>Modes</h3>
368
410
<p><strong>Constant Rate</strong> (mode 2): pattern plays at a fixed frame rate. Set <code>Frame Rate</code> in fps.</p>
369
411
<p><strong>Closed-Loop</strong> (mode 4): pattern responds to analog input. Set <code>Gain</code> value.</p>
370
412
<p>The irrelevant parameter is automatically dimmed and disabled.</p>
371
413
372
414
<h3>Empty pattern = allOff</h3>
373
-
<p>If you leave the Pattern File field empty for a condition, the YAML export generates an <code>allOff</code> controller command. This is useful for dark control conditions.</p>
415
+
<p>If you leave the Pattern File field empty for a trialParams command, the condition exports with an <code>allOff</code> controller command. This is useful for dark control conditions.</p>
0 commit comments