forked from labstreaminglayer/App-LabRecorder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
199 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,32 @@ | ||
# === Storage Location === | ||
# the default file name can be something like C:\\Recordings\\untitled.xdf, but can also contain a | ||
# placeholder for a running number (incremented per experiment session) called %n, and a | ||
# placeholder for a "block" label %b (if the config script provides a list of block names that | ||
# consitute a session | ||
# The syntax is as in: StorageLocation = "C:\\Recordings\\subject%n\\block_%b.xdf" | ||
|
||
StorageLocation=C:\Recordings\CurrentStudy\exp%n\untitled.xdf | ||
|
||
#OnlineSync=["ActiChamp-0 (User-PC)" post_ALL] | ||
|
||
# === Required Streams === | ||
# This is optionally a list of streams that are required for the recording; | ||
# a warning is issued if one of the streams is not present when the record button is pressed | ||
# The syntax is as in: RequiredStreams = ["BioSemi (MyHostname)","PhaseSpace (MyHostname)","Eyelink (AnotherHostname)"] | ||
# where the format is identical to what the LabRecorder displays in the "Record from streams" list. | ||
|
||
RequiredStreams=[] | ||
OnlineSync=[] | ||
#OnlineSync=[ActiChamp-0 (DM-Laptop) post_ALL, LiveAmpSN-054211-0237 (User-PC) post_ALL ] | ||
|
||
# === Block Names === | ||
# This is optionally a list of blocks that make up a recording session. The blocks are displayed in | ||
# a list box where the experiment can select a block before pressing record. If used, the blocks | ||
# may serve as a reminder of where they are in the experiment, but more practically, can be | ||
# used to determine the file name of the recording. Power users can define scriptable actions | ||
# associated with selecting a block or pressing Start/Stop for a given block (e.g., for remote | ||
# control). | ||
# The syntax is as in: SessionBlocks = [Training,PreBaseline,MainSection,PostBaseline] | ||
|
||
SessionBlocks=[] | ||
|
||
# From here on, none of the following is currently implemented. | ||
# It stays in case LabRecorder goes back to its previous python implementation, or | ||
# it a Lua interpreter ever gets rolled into the current C++ implementation. | ||
|
||
# === Extra checks to apply to some of the streams === | ||
# Note that this is an optional advanced feature that is aimed at power users. | ||
# For a subset of streams, a list of [condition,errormessage,condition,errormessage, ...] can be | ||
# given to inform the experimenter of possible problems with the recording setup (e.g., a device | ||
# was mis-configured); the syntax of the condition strings is XPath 1.0 (applied to the meta-data | ||
# of the stream) and the overall format for the ExtraCondtions variable is that of a Python | ||
# dictionary. | ||
# See sample_config.cfg for an example of the syntax | ||
|
||
ExtraChecks={} | ||
|
||
|
||
|
||
# === Optional script actions === | ||
# Functions can be defined here that get called when the given action in the Experimenter GUI | ||
# is triggered. For example, thi can be used to remote-control an experiment program on the | ||
# Subject's PC. If the function throws an exception, an warning message is presented to the | ||
# user to alert him of a possible problem. The user can choose to continue recording anyway. | ||
# The script actions are implemented as Python functions; they may refer to the previously | ||
# declared config variables. These functions will only be triggered when EnableScriptedActions | ||
# is set to True. | ||
|
||
# set this to true to enable the below remote-control scripts | ||
EnableScriptedActions = False | ||
# you also need to set the correct hostname/IP address that hosts your experiment program | ||
#SNAPHost = ("localhost",7897) | ||
|
||
#def on_init(self): | ||
# print "Intitializing..." | ||
|
||
#def on_selectblock(self,blockname): | ||
# print "Loading block ", blockname, " in SNAP." | ||
# sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
# sock.settimeout(3) | ||
# sock.connect(self.SNAPHost) | ||
# sock.sendall("config " + blockname + "\n") | ||
# sock.close() | ||
|
||
#def on_startrecord(self,blockname,sessionnumber): | ||
# print "Starting block in SNAP." | ||
# sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
# sock.settimeout(3) | ||
# sock.connect(self.SNAPHost) | ||
# sock.sendall("setup permutation = " + str(sessionnumber) + "\n") | ||
# sock.sendall("start\n") | ||
# sock.close() | ||
|
||
#def on_stoprecord(self,blockname,sessionnumber): | ||
# print "Stopping block in SNAP." | ||
# sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
# sock.settimeout(3) | ||
# sock.connect(self.SNAPHost) | ||
# sock.sendall("stop\n") | ||
# sock.close() | ||
|
||
#def on_pauserecord(self,blockname,sessionnumber): | ||
# pass | ||
|
||
#def on_quit(self): | ||
# pass | ||
; === Storage Location === | ||
; the default file name can be something like C:\\Recordings\\untitled.xdf, but can also contain a | ||
; placeholder for a running number (incremented per experiment session) called %n, and a | ||
; placeholder for a "block" label %b (if the config script provides a list of block names that | ||
; consitute a session | ||
; The syntax is as in: StorageLocation = "C:\\Recordings\\subject%n\\block_%b.xdf" | ||
|
||
StorageLocation=C:/Recordings/CurrentStudy/exp%n/untitled.xdf | ||
|
||
;OnlineSync=["ActiChamp-0 (User-PC)" post_ALL] | ||
|
||
; === Required Streams === | ||
; This is optionally a list of streams that are required for the recording; | ||
; a warning is issued if one of the streams is not present when the record button is pressed | ||
; The syntax is as in: RequiredStreams = "BioSemi (MyHostname)","PhaseSpace (MyHostname)","Eyelink (AnotherHostname)" | ||
; where the format is identical to what the LabRecorder displays in the "Record from streams" list. | ||
|
||
RequiredStreams= | ||
SessionBlocks="T1", "T2", "T3" | ||
|
||
|
||
; === Block Names === | ||
; This is optionally a list of blocks that make up a recording session. The blocks are displayed in | ||
; a list box where the experiment can select a block before pressing record. If used, the blocks | ||
; may serve as a reminder of where they are in the experiment, but more practically, can be | ||
; used to determine the file name of the recording. Power users can define scriptable actions | ||
; associated with selecting a block or pressing Start/Stop for a given block (e.g., for remote | ||
; control). | ||
; The syntax is as in: SessionBlocks = "Training","PreBaseline","MainSection","PostBaseline" | ||
|
||
OnlineSync="SendDataC (Testpc) post_ALL", "Test (Testpc) post_clocksync" | ||
; OnlineSync="ActiChamp-0 (DM-Laptop) post_ALL", "LiveAmpSN-054211-0237 (User-PC) post_ALL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <iostream> | ||
|
||
int main() { | ||
const double sampling_rate = 500, | ||
sample_interval = 1.0 / sampling_rate, | ||
first_timestamp = 60*60*24*365*48; // e.g. a unix timestamp | ||
double last_timestamp = first_timestamp; | ||
int full = 0, deduced = 0; | ||
const int iterations = 100000; | ||
double timestamps[iterations]; | ||
for(int i=0;i<iterations; ++i) | ||
timestamps[i] = first_timestamp + i/sampling_rate; | ||
for(int i=0; i<iterations; ++i) { | ||
if(last_timestamp + sample_interval == timestamps[i]) | ||
deduced++; | ||
else full++; | ||
last_timestamp = timestamps[i]; | ||
} | ||
std::cout << "Deduced: " << deduced << "\nFully written: " << full << std::endl; | ||
return 0; | ||
} | ||
|
||
|
Oops, something went wrong.