videoLat 2.0
Video conferencing delay measurements
Public Member Functions | Static Public Member Functions | Protected Attributes | Properties
HardwareRunManager Class Reference

#import <HardwareRunManager.h>

Inheritance diagram for HardwareRunManager:
Inheritance graph
[legend]
Collaboration diagram for HardwareRunManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(HardwareRunManager *) - init
 Initializer.
(void) - stop
 Called when the user stops a measurement run, via stopMeasuring from RunTypeView.
(void) - _switchToDevice:
(IBAction) - selectBase:
(IBAction) - periodChanged:
 Action message for samplePeriodMs UI elements.
(void) - _updatePeriod
(void) - _periodic:
(void) - _update:
(IBAction) - stopPreMeasuring:
 Stop pre-measuring because we have enough prerun samples.
(void) - triggerNewOutputValue
(void) - restart
 Signals that a measurement run should be restarted (for example because the input device has changed).
(void) - startCapturing:
(void) - stopCapturing
 Stop forwarding frames to RunManager but continue running.

Static Public Member Functions

(void) + initialize
 Class initializer.

Protected Attributes

BOOL alive
 True when the _periodic method should run.
BOOL connected
 True if the hardware device is connected.
NSString * lastError
 Last error message from device.
uint64_t outputTimestamp
 When the last output light level change was made.
BOOL newOutputValueWanted
 True if we need to change the output light level.
double outputLevel
 Current output light level.
NSString * oldOutputCode
 Last output code reported to collector.
double inputLevel
 Current input light level.
double minInputLevel
 Lowest analog input level seen.
double maxInputLevel
 Highest analog input level seen.
uint64_t inputTimestamp
 When inputLevel was measured.

Properties

IBOutlet NSButton * bConnected
 Indicator for the user that the selected device works.
IBOutlet NSButton * bInputValue
 UI element: feedback on light/no light detected.
IBOutlet NSTextField * bInputNumericValue
 UI element: feedback on analog input received.
IBOutlet NSTextField * bInputNumericMinValue
 UI element: feedback on analog input received.
IBOutlet NSTextField * bInputNumericMaxValue
 UI element: feedback on analog input received.
IBOutlet HardwareOutputViewoutputView
 Assigned in NIB: visual feedback view of output for the user.
IBOutlet NSObject
< ClockProtocol > * 
clock
 Assigned in NIB: clock source.
NSString * deviceID
 Unique string that identifies the input device.
NSString * deviceName
 Human-readable string that identifies the input device.
int samplePeriodMs
 How often we sample the hardware.
IBOutlet NSStepper * bSamplePeriodStepper
 UI element for samplePeriodMs.
IBOutlet NSTextField * bSamplePeriodValue
 UI element for samplePeriodMs.
NSObject< HardwareLightProtocol > * device
 Hardware device handler.

Detailed Description

A Subclass of BaseRunManager geared towards doing hardware-assisted video measurements. It works together with an object implementing the low-level HardwareLightProtocol to generate light/no light conditions and detect them.

This class works closely together with HardwareLightProtocol, and actually with its only current implementation, LabJackDevice. Testing with other hardware and allowing selection of input and output device has not been implemented.

When compared to the other run manager this class also implements the input and selection view object functionality. Should be fixed at some point.


Member Function Documentation

- (void) _periodic: (id)  sender

The worker thread. Once every millisecond (at most) it calls the light method on the device to set the output light level and read the input light level. Calls _update on the main thread if anything has changed.

- (void) _update: (id)  sender

Act on changes in input and output levels. Updates the UI, calls collector methods to record reception and transmission, triggers a new output value when needed.

- (void) _updatePeriod

Internal: update UI to show samplePeriodMs.

- (void) startCapturing: (BOOL)  showPreview

Start capturing, each captured frame will be forwarded to the InputRunManager

Parameters:
showPreviewSet to true if the capturer should show its preview window (if applicable)

Reimplemented from <InputCaptureProtocol>.

- (void) triggerNewOutputValue

Prepare data for a new delay measurement. Called on the output companion, should create a pattern that is distinghuisable from the previous pattern and display it.

Reimplemented from BaseRunManager.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Properties Defines