REM >EvInfuse REM ___________________________________________________________________ REM Copy of !Evenden, but with 0-20-60s delays and other modifications REM for intracerebral infusions. REM USES EVENDEN SOURCE CODE AS A LIBRARY. REM 12 August 1999. REM ___________________________________________________________________ progname$="EvInfuse" version_date$="14 Aug 99" debug%=0 simple%=0 PROCinit :REM Arachnid init PROCkill_all :REM Arachnid init LIBRARY ".ProgLibs.Ascii" LIBRARY ".ProgLibs.UI" LIBRARY ".ProgLibs.DateTime" LIBRARY ".ProgLibs.Filename" date_time$ = FNdate_time_code LIBRARY ".ProgLibs.Arachnid" LIBRARY ".ProgLibs.BoxConst" PROCcombined_boxes LIBRARY ".ProgLibs.DelayLib" maxnchoicetrials%=100:PROCdelay_lib_init REM ___________________________________________________________________ significantly different LIBRARY ".!Evenden.Evenden" infusing% = 1: diffusing% = 2 inf_time% = 12500 :REM 125s of infusion diff_time% = 6000 :REM 60s of diffusion inftimer_status%=no% DIM started%(nboxes%) DIM box_start_time%(nboxes%) number_of_blocks% = 3 trials_per_block% = 10 DIM delay_values%(number_of_blocks%) FOR dummy%=1 TO number_of_blocks%:READ delay_values%(dummy%):NEXT REM ___________________________________________________________________ significantly different DATA 0, 2000, 6000 increasing%=1:decreasing%=2:zero%=3 delay_method%=increasing% DIM delay_method_per_box%(nboxes%) specify_method_per_box% = no% global_unadj_delay% = 0 :REM No delay on the unadjusted lever unadj_nreinf% = 1 :REM 1 pellet on the unadjusted lever adj_nreinf% = 4 :REM 4 pellets on the adjusted lever nchoicetrials% = number_of_blocks% * trials_per_block% pellet_gap% = 50 lights_bridge_delay%=no% :REM default option initiation_limhold% = 1000 choice_limhold% = 1000 collection_limhold%=1000 reinf_collect_period%=600 iti_time% = 10000 IF debug%=1 THEN number_of_blocks% = 3 FOR dummy%=1 TO number_of_blocks%:READ delay_values%(dummy%):NEXT DATA 0, 200, 400 delay_method%=increasing% trials_per_block% = 2 nchoicetrials% = number_of_blocks% * trials_per_block% :REM 60 trials global_unadj_delay%=0 adj_nreinf%=2 initiation_limhold%=300 choice_limhold%=300 collection_limhold%=300 reinf_collect_period%=200 iti_time%=1700 ENDIF dummy% = RND(-TIME) PROCsay_hello REM ___________________________________________________________________ significantly different from now on COLOUR 3 PRINT''" ***************** EvInfuse - FOR INTRACEREBRAL DRUGS ************"'' COLOUR 7 PROCget_parameters PROCselect_filenames PROCwarn_kickoff PROCdisplay_screen PROCpipe_keybd(0,0,0,"FNev_keyboard_handler(",0,E%) FOR i%=1 TO nboxes% started%(i%) = no% finished%(i%) = no% PROCpipe_fkey(i%,0,1,"FNabort_box(",i%,E%) NEXT start_time% = TIME PROCpipe_timer(clock_timer%, 100, 100, "FNevinfuse_clock_tick(",0,E%) PROCwait(E%): *AE END DEF FNev_keyboard_handler(dummy%, bogus%) LOCAL b% IF bogus%=0 =0 key% = GET REM Space starts infusion timer IF key%=32 THEN PROCinftimer:=0 REM Keys 1-4 start boxes IF key%>=ASC("1") AND key%<=ASC("9") THEN b%=key%-ASC("0") ELSE =0 IF b%>nboxes% THEN =0 IF started%(b%)=yes% OR finished%(b%)=yes% THEN =0 box_start_time%(b%) = TIME started%(b%) = yes% PROCstart_box(b%) =0 REM Infusion timer lifted from CRF program. DEF PROCinftimer IF inftimer_status% <> no% THEN ENDPROC inftimer_status% = infusing% VDU 7 COLOUR 5:PRINTTAB(65,0);"Infusing... ":COLOUR 7 PROCpipe_timer(infusion_timer%,inf_time%,0,"FNinftimer2(",1,E%) ENDPROC DEF FNinftimer2(junk%,R%) IF R%=0 =0 inftimer_status% = diffusing% VDU 7 :REM beep COLOUR 5:PRINTTAB(65,0);"Diffusing...":COLOUR 7 PROCpipe_timer(infusion_timer%,diff_time%,0,"FNinftimer3(",1,E%) =0 DEF FNinftimer3(junk%,R%) IF R%=0 =0 inftimer_status% = no% VDU 7 PRINTTAB(65,0);" " =0 DEF FNevinfuse_clock_tick(dummy%, bogus%) IF R%=0 =0 LOCAL t%, box% REM Display session time at the top, for what that's worth t% = TIME - start_time% COLOUR4:PRINTTAB(clockx%,clocky%);t%DIV6000;" min ";(t%MOD6000)DIV100;" sec ";:COLOUR7 REM Display each box's elapsed time at the bottom FOR box%=1 TO nboxes% IF started%(box%)=yes% AND finished%(box%)=no% THEN REM so we don't see anything until the box starts, and the timer freezes when it's done. t% = TIME - box_start_time%(box%) COLOUR4:PRINTTAB(55,FNdisplay_line(nboxes%)+1+box%);"Box ";box%;": "t%DIV6000;" min ";(t%MOD6000)DIV100;" sec ";:COLOUR7 ENDIF NEXT =0