Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 8ed0bc61f74cbe8b9d07278a25fd9f49c0af3f2b authored by Kellen Vu on 03 November 2022, 01:23:38 UTC, committed by Kellen Vu on 03 November 2022, 01:23:38 UTC
Fixes a bug where eyeCalibration.mlapp was trying to get the sample rate from the wrong smr channel. I tested this in D243b, and it should work for other computers, but let me know if it doesn't.
1 parent 1611f97
  • Files
  • Changes
  • cd980e7
  • /
  • Experiment Protocols
  • /
  • Experiment_Default_D243a.s2s
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:8ed0bc61f74cbe8b9d07278a25fd9f49c0af3f2b
directory badge Iframe embedding
swh:1:dir:73ffcf87dce87be96f418e9499e77c2335fd199b
content badge Iframe embedding
swh:1:cnt:f7b89a8d10bda461114ed6af055ff366a168d6f5
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Experiment_Default_D243a.s2s
'--------------------------------------------------------------------------------
' IMPORT RIG-SPECIFIC PARAMETERS AND UNIVERSAL PARAMETERS
'--------------------------------------------------------------------------------
#include "C:\\Users\\Public\\RaymondLabCode\\Experiment Protocols\\RigChoice.s2s"
#include "C:\\Users\\Public\\RaymondLabCode\\Experiment Protocols\\Parameters_Universal_D243a.s2s"

'--------------------------------------------------------------------------------
' MAIN PROGRAM
'--------------------------------------------------------------------------------
ToolbarConfig();


'--------------------------------------------------------------------------------
' Toolbar Callbacks
'--------------------------------------------------------------------------------
Func ToolbarIdle%()
  'This function calls repeatedly whenever nothing else is happening
  'if runExmpt=1, it is used to run a full expmt automatically.  -HP
  'expmtMode: 0=habit, 1=0x, 2=2x, 3=ipsi stim, 4=contra stim
  'test: 0=wait, 1=test, 2=train

  ' Check a valid sampling view is running
  var currView := ViewKind();
  if  currView <> 0 then
      return 1;
  endif;

  'If an experiment is running:
  if runExpmt% = 1 then

      'Check the time. Seconds is the current time - compare it to the goal time of each segment
      if  MaxTime() > goalTime then

          docase

          ' GAP A
          case test% = 0 then
            SampleKey("0");
            SampleKey("x");
            goalTime := MaxTime() + 5;
            ToolbarInit%(); Yield();
            test% := 7;

          ' GAP B
          case test% = 7 then
            SampleKey("7");
            goalTime := MaxTime() + 5;
            ToolbarInit%(); Yield();


            ' Go to Pre/Post or Train/Test Section
            docase
              ' PRE & POST Tests
              case expmtLoc% = 1 then
                test% := 1;
              ' TEST/TRAIN Blocks
              case expmtLoc% = 2 then
                test% := 2;
                ' If you have already done the test/train blocks, quit instead.
                if rep% = (nBlocks%+1)  then
                  ToolbarQuitExpmt%();
                  Return(1);
                endif
            endcase
            runFlash(); Yield();
            ToolbarInit%(); Yield();

          ' PRE AND POST TEST
          case test% = 1 then
            SampleKey("1");
            SampleKey("X");
            goalTime := MaxTime() + testLength;
            test% := 0;

            ' Keep track of how many PRE/POST tests that you've run
            prePostNum := prePostNum + 1;

            if prePostNum > 2 then
              expmtLoc% := 2;
              ' This check is for the 'T-35' test
              if rep% < nBlocks% then
                prePostNum := 1;
              endif
            else
              expmtLoc% := 1;
            endif

            if expmtMode = 5 then
              ToolbarStepOn%();
            else
              ToolbarSineStart%();
            endif;

          ' BLOCK: TEST
          case test% = 2 then
            SampleKey("2");
            SampleKey("X");
            goalTime := MaxTime() + testLength;

            testrep% := testrep% + 1;

            if testrep% = nTestreps% then
              test% := 3;
              rep% := rep% + 1;
            else
              test% := 0;
            endif;

            ' Start correct Stim, STEP or SINE
            if expmtMode = 5 then
              ToolbarStepOn%();
            else
              ToolbarSineStart%();
            endif;

          ' BLOCK: TRAIN
          case test% = 3 then
            SampleKey("3");
            SampleKey("x");
            SampleKey("X");
            goalTime := MaxTime() + runLength;

            if rep% < (nBlocks%+1) then
              docase
                '3 = ipsi, 4 = contra
                case expmtMode = 3 or expmtMode = 4 then
                    ToolbarStimOn%();
                '1 = x0, 2 = x2
                case expmtMode = 1 or expmtMode = 2 then
                    ToolbarLightOn%();
                '5 = step
                case expmtMode = 5 then
                    ToolbarStepOff%(); Yield();
                    ToolbarLightOn%(); Yield();
                    ToolbarStepOn%();
              endcase;
            else
              ToolbarSineStop%();
              ToolbarStepOff%();
              expmtLoc% := 1;
            endif;

            if rep% = nBlocks% then
              expmtLoc% := 1;
            endif

            test% := 0;
            testrep% := 0;

          endcase;
      endif;
  endif;
  Return(1);
End

'--------------------------------------------------------------------------------
'--------------------------------------------------------------------------------
' Configure expmt settings window
'--------------------------------------------------------------------------------
'--------------------------------------------------------------------------------

Func ToolbarConfigExpmt%()
var movementType;
var learningType;

var stimType;
var lightType;
var optoType;
var gp%;

DlgCreate("Experiment Settings", 0, 0, 50);  'Start new dialog
DlgInteger(1,"Number of test/train blocks",0,100,0,0,1);
DlgInteger(2,"Number of tests per block",1,100,0,0,1);
DlgReal(3,"Train length (s)",0,5000);
DlgReal(4,"Test length (s)",0,5000);
DlgList(5,"Movement Type", "sine|step");
DlgList(6,"Learning Type", "x2 (gain up)|x0 (gain down)|OKR (drum only)|habituation (chair only)");
DlgList(7,"Opto During Training", "none|ipsi|contra");
DlgList(8,"Light During Training", "Always On|none|match Opto");

DlgShow(nBlocks%, nTestreps%, runLength, testLength, movementType, learningType, optoType, lightType);

'--------------------------------------------------------------------------------
' MOVEMENT AND LEARNING TYPES
'--------------------------------------------------------------------------------
docase
  ' SINE
  case movementType = 0 then

    docase
      ' SINE | x2
      case learningType = 0 then
        sinPhDrum := -90;
        sinPhChair := 90;
        sinAmpChair := 10;
        sinAmpDrum := 10;

      ' SINE | x0
      case learningType = 1 then
        sinPhDrum := 90;
        sinPhChair := 90;
        sinAmpChair := 10;
        sinAmpDrum := 10;

      ' SINE | drum only
      case learningType = 2 then
        sinPhDrum := 90;
        sinPhChair := 90;
        sinAmpChair := 0;
        sinAmpDrum := 10;

      ' SINE | chair only
      case learningType = 3 then
          sinPhDrum := 90;
          sinPhChair := 90;
          sinAmpChair := 10;
          sinAmpDrum := 0;


    endcase;
    ToolbarSineConfig%()

  ' STEP
  case movementType = 1 then

    docase
      ' STEP | x2
      case learningType = 0 then
        stepAmpChair := 10;
        stepAmpDrum := -10;

      ' STEP | x0
      case learningType = 1 then
        stepAmpChair := 10;
        stepAmpDrum := 10;

      ' STEP | drum only
      case learningType = 2 then
        stepAmpChair := 0;
        stepAmpDrum := 10;

      ' STEP | chair only
      case learningType = 3 then
        stepAmpChair := 10;
        stepAmpDrum := 0;

    endcase;
    StepConfigWindow%()

endcase;

'--------------------------------------------------------------------------------
' STIM TYPES
'--------------------------------------------------------------------------------
docase
  ' none
  case optoType = 0 then
    stepStim := 0;

  ' ipsi
  case optoType = 1 then
    ToolbarPulseConfig%()

  ' contra
  case optoType = 2 then
    ToolbarPulseConfig%()

endcase;

SetSequencerValues();
Return(1);
End
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API