/// <summary> /// This method checks the current trial for the contained /// slides and if there is more than one it populates /// the given <see cref="TrialTimeLine"/> with <see cref="TrialEvents"/>. /// </summary> /// <param name="timeline">A <see cref="TrialTimeLine"/> to display the trial sections.</param> protected void LoadTrialSlidesIntoTimeline(TrialTimeLine timeline) { // Update time line with events int slideCount = this.CurrentTrial.Count; if (slideCount > 1) { timeline.Duration = slideCount * 1000; this.Picture.SectionEndTime = slideCount * 1000; SortedList <int, TrialEvent> trialEvents = new SortedList <int, TrialEvent>(); for (int i = 0; i < slideCount; i++) { Slide slide = this.CurrentTrial[i]; TrialEvent slideEvent = new TrialEvent(); slideEvent.Type = EventType.Slide; int time = i * 1000; slideEvent.Time = time; if (i > 0) { trialEvents.Add(time, slideEvent); } } timeline.TrialEvents = trialEvents; timeline.HighlightFirstSlide(); } else { timeline.RemoveEvents(); } }
public void logMenu(string buttonName) { if (isServer) { TrialEvent tmp = new TrialEvent(TrialEventType.Hit, "Menu", Time.time); tmp.note = buttonName; log(tmp); } }
public void RpcLog(TrialEvent tEvent) { print(tEvent.toRow()); #if UNITY_EDITOR if (writer != null) { writer.WriteLine(tEvent.toRow()); } #endif }
public void logMenuTaskStartet() { TrialEvent tmp = new TrialEvent(TrialEventType.TaskStart, "Menu", Time.time, currentMenuTarget); log(tmp); }
public void log(TrialEvent tEvent) { localPlayer.CmdLog(tEvent); }
internal void CmdLog(TrialEvent tEvent) { tEvent.time = Time.time; //set time to server time logger.RpcLog(tEvent); }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the TrialEventOccuredEventArgs class. /// </summary> /// <param name="newTrialEvent">A <see cref="TrialEvent"/> with /// the occured trial event and params.</param> /// <param name="newEventTime">A <see cref="Int64"/> with the time the event occured /// measured in sample time.</param> public TrialEventOccuredEventArgs(TrialEvent newTrialEvent, long newEventTime) { this.trialEvent = newTrialEvent; this.eventTime = newEventTime; }