videoLat  2.1
Video conferencing delay measurements
BaseRunManager.h
Go to the documentation of this file.
1 //
5 // Copyright 2010-2019 Centrum voor Wiskunde en Informatica. Licensed under GPL3.
6 //
7 //
8 
9 #import <Foundation/Foundation.h>
10 #import "protocols.h"
11 #import "MeasurementType.h"
12 #import "RunCollector.h"
13 #import "RunManagerView.h"
14 #import "RunStatusView.h"
15 #ifdef WITH_UIKIT
17 #endif
18 #ifdef WITH_APPKIT
19 #import "RunManagerView.h"
20 #endif
21 // Forward delcaration
22 @class NetworkIODevice;
23 
34 @interface BaseRunManager : NSObject <RunManagerProtocol> {
38  uint64_t prepareMaxWaitTime;
40 
42 
44 
45  NSString *prevInputCode;
48 
49  NSString *baseName; //<! Name of our base (calibration) measurement
50 }
51 
52 @property(weak) IBOutlet NSObject<InputSelectionView> *selectionView;
53 @property(weak) IBOutlet NSObject<InputDeviceProtocol> *capturer;
54 @property(weak) IBOutlet NSorUIView <OutputDeviceProtocol> *outputView;
55 @property(weak) IBOutlet NSObject<NewMeasurementDelegate> *completionHandler;
56 @property(weak) IBOutlet NetworkIODevice *networkIODevice;
57 @property(weak) IBOutlet NSObject<ClockProtocol> *clock;
58 
59 + (void)initialize;
60 
66 + (void)registerClass: (Class)managerClass forMeasurementType: (NSString *)name;
67 
73 + (Class)classForMeasurementType: (NSString *)name;
74 
80 + (void)registerNib: (NSString*)nibName forMeasurementType: (NSString *)name;
81 
87 + (NSString *)nibForMeasurementType: (NSString *)name;
88 
89 #ifdef WITH_UIKIT
90 + (void)registerSelectionNib: (NSString*)nibName forMeasurementType: (NSString *)name;
96 
102 + (NSString *)selectionNibForMeasurementType: (NSString *)name;
103 
104 #endif
105 
106 @property(strong) MeasurementType *measurementType;
107 
111 @property(strong) NSString * outputCode;
114 @property(strong) NSString * prevOutputCode;
115 
116 - (void)terminate;
117 - (void)stop;
118 
119 - (IBAction)startPreMeasuring: (id)sender;
120 - (void)stopPreMeasuring: (id)sender;
121 - (IBAction)startMeasuring: (id)sender;
122 - (IBAction)stopMeasuring: (id)sender;
123 
128 - (void)selectMeasurementType: (NSString *)typeName;
129 
130 #ifdef WITH_UIKIT
131 
135 - (void)runForType: (NSString *)measurementTypeName withBase: (NSString *)baseMeasurementName;
136 #endif
137 
139 - (void)restart;
140 
144 - (void)triggerNewOutputValue;
145 
149 
151 - (void) prepareReceivedValidCode: (NSString *)code;
152 
153 @property bool running;
154 @property bool preparing;
155 
156 @property(weak) IBOutlet RunCollector *collector;
157 @property(weak) IBOutlet RunStatusView *statusView;
158 #ifdef WITH_UIKIT
159 @property(weak) IBOutlet MeasurementContainerViewController *measurementMaster;
160 #else
161 @property(weak) IBOutlet RunManagerView *measurementMaster;
162 #endif
163 - (BOOL) prepareInputDevice;
164 
165 - (BOOL) prepareOutputDevice;
166 
170 
172 - (void)reportResultsToRemote: (MeasurementDataStore *)mr;
173 
175 - (void)codeRequestedByMaster: (NSString *)code;
176 
178 - (void)reportHeartbeat;
179 
181 - (void)receivedMeasurementResult: (MeasurementDataStore *)result;
182 @end
IBOutlet RunCollector * collector
Initialized in the NIB, RunCollector for this measurement run.
Definition: BaseRunManager.h:156
IBOutlet RunStatusView * statusView
Initialized in the NIB, RunStatusView for this measurement run.
Definition: BaseRunManager.h:157
bool running
True after user has pressed "run" button, false again after pressing "stop".
Definition: BaseRunManager.h:153
IBOutlet NSObject< InputDeviceProtocol > * capturer
Assigned in NIB: input capturer.
Definition: BaseRunManager.h:53
IBOutlet NSObject< NewMeasurementDelegate > * completionHandler
Optionally assigned in NIB: handler to open completed measurement.
Definition: BaseRunManager.h:55
Definition: MeasurementType.h:22
void triggerNewOutputValueAfterDelay()
Definition: BaseRunManager.m:601
int prevInputCodeDetectionCount
How often prevInputCode was detected.
Definition: BaseRunManager.h:46
uint64_t averageFinderDuration
Running average of how much the patternfinder takes.
Definition: BaseRunManager.h:41
BOOL showPreviewDuringRun
True if we want to see the preview while running (false for QR-code roundtrip)
Definition: BaseRunManager.h:37
BOOL networkHelper
true if this is a networked helper, i.e. it has no collector.
Definition: BaseRunManager.h:35
Definition: MeasurementContainerViewController.h:17
NSString * outputCode
Definition: BaseRunManager.h:111
Defines RunStatusView object.
Definition: RunStatusView.h:18
Defines the RunCollector object.
void initialize()
Class initializer.
Definition: BaseRunManager.m:39
void triggerNewOutputValue()
Definition: BaseRunManager.m:591
NSString * prevOutputCode
Definition: BaseRunManager.h:114
Definition: RunCollector.h:22
int uncertainDetectionCount
How often we detected no reasonable code.
Definition: BaseRunManager.h:47
Definition: MeasurementDataStore.h:19
Holds definition of MeasurementContainerViewController object (iOS only).
IBOutlet NSObject< InputSelectionView > * selectionView
Assigned in NIB: view that allows selection of input device.
Definition: BaseRunManager.h:52
Definition: RunManagerView.h:24
IBOutlet NSorUIView< OutputDeviceProtocol > * outputView
Assigned in NIB: Displays current output QR code.
Definition: BaseRunManager.h:54
BOOL prepareMeasurementFromRemoteData()
Definition: BaseRunManager.m:290
bool preparing
True after user has pressed "prepare" button, false again after pressing "run".
Definition: BaseRunManager.h:154
void reportHeartbeat()
Called whenever "nothing really happened", will cause a heartbeat to be sent when helper...
Definition: BaseRunManager.m:823
void restart()
Signals that a measurement run should be restarted (for example because the input device has changed)...
Definition: BaseRunManager.m:462
BOOL networkServer
true if this run manager is a network server (i.e. producing visual output to let the other side conn...
Definition: BaseRunManager.h:36
Defines RunManagerView object.
int prepareMoreNeeded
Internal: How many more prerun correct catches we need.
Definition: BaseRunManager.h:39
void stop()
Called when the user stops a measurement run, via stopMeasuring from RunTypeView. ...
Definition: BaseRunManager.m:547
IBOutlet NetworkIODevice * networkIODevice
For hetwork measurements: the connection to the other side.
Definition: BaseRunManager.h:56
IBOutlet RunManagerView * measurementMaster
Initialized in the NIB, our parent object.
Definition: BaseRunManager.h:161
uint64_t prepareMaxWaitTime
Internal: How long to wait for prerun code finding.
Definition: BaseRunManager.h:38
NSString * prevInputCode
Last input code detected.
Definition: BaseRunManager.h:45
void prepareReceivedNoValidCode()
Internal: no QR code was received in time during prerun.
Definition: BaseRunManager.m:611
uint64_t outputCodeTimestamp
When the last output code change was made.
Definition: BaseRunManager.h:43
IBOutlet NSObject< ClockProtocol > * clock
Input manager clock.
Definition: BaseRunManager.h:57
Definition of MeasurementType object.
void terminate()
Prepare for deallocation. Severs links with companion and releases resources.
Definition: BaseRunManager.m:113
Various protocols for which multiple implementations exist.
Definition: BaseRunManager.h:34
Definition: NetworkIODevice.h:17