Example

Loading...
Searching...
No Matches
CNFBMetricsProductivity.h
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5#include "Capsule/CDefinesPrivate.h"
6#include "Capsule/CError.h"
7#include "Capsule/CNFBCalibrator.h"
8#include "Capsule/CSession.h"
9
10#ifdef __cplusplus
11 extern "C" {
12#endif
13
14 CLC_CLASS_WN(ProductivityMetricsPrivate, clCNFBMetricProductivity);
15
26 CL_DLL clCNFBMetricProductivity clCNFBMetricsProductivity_Create(
27 clCSession session, const char* path, double speed, double maxSpeed,
28 double slowDown, clCError* error) NOEXCEPT;
38 CL_DLL clCNFBMetricProductivity clCNFBMetricsProductivity_CreateCalibrated(
39 clCNFBCalibrator calibrator, const char* path, double speed, double maxSpeed,
40 double slowDown, clCError* error) NOEXCEPT;
46 CL_DLL void
47 clCNFBMetricsProductivity_Destroy(clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
53 CL_DLL void
54 clCNFBMetricsProductivity_InitializeNFB(clCNFBMetricProductivity nfbMetrics,
55 const char* platformAddress,
56 clCError* error) NOEXCEPT;
57
58 CLC_STRUCT(clCNFBMetricsProductivityCalibratedDelegate);
59 typedef void (*clCNFBMetricsProductivityCalibratedHandler)(
60 clCNFBMetricProductivity);
64 CL_DLL void clCNFBMetricsProductivity_CalibratedEvent_Set(
65 clCNFBMetricsProductivityCalibratedDelegate delegate,
66 clCNFBMetricsProductivityCalibratedHandler handler) NOEXCEPT;
67
71 CL_DLL clCNFBMetricsProductivityCalibratedDelegate
72 clCNFBMetricsProductivity_GetOnBaselineCalibratedEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
73
74 typedef struct clCNFBMetricsProductivityBaselines {
75 float gravityBaseline;
76 float productivityBaseline;
77 float fatigueBaseline;
78 float reverseFatigueBaseline;
79 float relaxBaseline;
80 float concentrationBaseline;
81} clCNFBMetricsProductivityBaselines;
82 CLC_STRUCT(clCNFBMetricsProductivityInitialBaselineCalibratedDelegate);
83 typedef void (*clCNFBMetricsProductivityInitialBaselineCalibratedHandler)(
84 clCNFBMetricProductivity, const clCNFBMetricsProductivityBaselines*);
88 CL_DLL void clCNFBMetricsProductivity_InitialBaselineCalibratedEvent_Set(
89 clCNFBMetricsProductivityInitialBaselineCalibratedDelegate delegate,
90 clCNFBMetricsProductivityInitialBaselineCalibratedHandler handler) NOEXCEPT;
91
95 CL_DLL clCNFBMetricsProductivityInitialBaselineCalibratedDelegate
96 clCNFBMetricsProductivity_GetOnInitialBaselineCalibratedEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
97
98 typedef struct clCNFBMetricsProductivityIndividualIndexes {
99 float IAF;
100 float IAPF;
101 float IAPFPowerNormalized;
102 float alphaRangeBegin;
103 float alphaRangeEnd;
104 uint8_t relaxPoint;
105 uint8_t stressPoint;
106 float relaxBaseline;
107 float fatigueBaseline;
108 float gravityBaseline;
109 float concentrationBaseline;
110 int isArtifacted;
111} clCNFBMetricsProductivityIndividualIndexes;
112
113 CLC_STRUCT(clCNFBMetricsProductivityIndividualDelegate);
114 typedef void (*clCNFBMetricsProductivityIndividualHandler)(clCNFBMetricProductivity,
115 const clCNFBMetricsProductivityIndividualIndexes*);
116
120 CL_DLL clCNFBMetricsProductivityIndividualDelegate
121 clCNFBMetricsProductivity_GetOnIndividualMeasuredEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
125 CL_DLL void clCNFBMetricsProductivity_IndividualMeasuredEvent_Set(
126 clCNFBMetricsProductivityIndividualDelegate delegate,
127 clCNFBMetricsProductivityIndividualHandler handler) NOEXCEPT;
128
129 typedef struct clCNFBMetricsProductivityValues {
130 float fatigueScore;
131 float gravityScore;
132 float concentrationScore;
133 float relaxationScore;
134 float accumulatedFatigue;
135 int32_t fatigueGrowthRate;
136} clCNFBMetricsProductivityValues;
137
138 CLC_STRUCT(clCNFBMetricsProductivityValuesDelegate);
139 typedef void (*clCNFBMetricsProductivityValuesHandler)(clCNFBMetricProductivity,
140 const clCNFBMetricsProductivityValues*);
144 CL_DLL clCNFBMetricsProductivityValuesDelegate
145 clCNFBMetricsProductivity_GetOnProductivityValuesEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
149 CL_DLL void clCNFBMetricsProductivity_ValuesEvent_Set(
150 clCNFBMetricsProductivityValuesDelegate delegate,
151 clCNFBMetricsProductivityValuesHandler handler) NOEXCEPT;
152
158 CL_DLL float clCNFBMetricsProductivity_GetIAPF(
159 clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
165 CL_DLL float
166 clCNFBMetricsProductivity_GetIAF(clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
170 CL_DLL void clCNFBMetricsProductivity_ResetAccumulatedFatigue(clCNFBMetricProductivity nfbMetrics,
171 clCError* error) NOEXCEPT;
175 typedef struct clCNFBUserArtifacts {
179 const uint8_t* artifactsData;
180 uint64_t artifactsSize;
181 int64_t timestamp;
182} clCNFBUserArtifacts;
183
184 CLC_STRUCT(clCNFBMetricsProductivityArtifactsDelegate);
185 typedef void (*clCNFBMetricsProductivityArtifactsHandler)(
186 clCNFBMetricProductivity, const clCNFBUserArtifacts*);
190 CL_DLL clCNFBMetricsProductivityArtifactsDelegate
191 clCNFBMetricsProductivity_GetOnArtifactsEvent(
192 clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
196 CL_DLL void clCNFBMetricsProductivity_ArtifactsEvent_Set(
197 clCNFBMetricsProductivityArtifactsDelegate delegate,
198 clCNFBMetricsProductivityArtifactsHandler handler) NOEXCEPT;
199
200//------------------
201 typedef float clCNFBMetricsProductivity_CurrentPowerIAPF,
202 clCNFBMetricsProductivity_relaxValue;
203
204 CLC_STRUCT(clCNFBMetricsProductivityTrainingInfoDelegate);
205 typedef void (*clCNFBMetricsProductivityTrainingInfoHandler)(
206 clCNFBMetricProductivity, clCNFBMetricsProductivity_CurrentPowerIAPF,
207 clCNFBMetricsProductivity_relaxValue);
208
209 CL_DLL void clCNFBMetricsProductivity_TrainingInfoEvent_Set(
210 clCNFBMetricsProductivityTrainingInfoDelegate delegate,
211 clCNFBMetricsProductivityTrainingInfoHandler handler) NOEXCEPT;
212
213 CL_DLL clCNFBMetricsProductivityTrainingInfoDelegate
214 clCNFBMetricsProductivity_GetOnTrainingInfoEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
215
216//----------------
217
218 CLC_STRUCT(clCNFBMetricsProductivityEventDelegate);
219 typedef void (*clCNFBMetricsProductivityEventHandler)(clCNFBMetricProductivity, float);
224 CL_DLL void clCNFBMetricsProductivity_UpdateEvent_Set(
225 clCNFBMetricsProductivityEventDelegate delegate,
226 clCNFBMetricsProductivityEventHandler handler) NOEXCEPT;
230 CL_DLL clCNFBMetricsProductivityEventDelegate
231 clCNFBMetricsProductivity_GetOnUpdateEvent_1min(
232 clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
236 CL_DLL clCNFBMetricsProductivityEventDelegate
237 clCNFBMetricsProductivity_GetOnUpdateEvent_5min(
238 clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
242 CL_DLL clCNFBMetricsProductivityEventDelegate
243 clCNFBMetricsProductivity_GetOnUpdateEvent_15min(
244 clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
248 CL_DLL clCNFBMetricsProductivityEventDelegate
249 clCNFBMetricsProductivity_GetOnUpdateEvent_30min(
250 clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
254 CL_DLL clCNFBMetricsProductivityEventDelegate
255 clCNFBMetricsProductivity_GetOnUpdateEvent_60min(
256 clCNFBMetricProductivity nfbMetrics) NOEXCEPT;
257
258#ifdef __cplusplus
259}
260#endif
CDefinesPrivate.h
CLC_STRUCT
#define CLC_STRUCT(Name)
Definition CDefinesPrivate.h:24
NOEXCEPT
#define NOEXCEPT
Definition CDefinesPrivate.h:52
CL_DLL
#define CL_DLL
Definition CDefinesPrivate.h:21
CLC_CLASS_WN
#define CLC_CLASS_WN(Wrapped, Name)
Definition CDefinesPrivate.h:54
CError.h
clCError
clCError
Capsule error.
Definition CError.h:8
CNFBCalibrator.h
clCNFBMetricsProductivity_GetOnUpdateEvent_60min
CL_DLL clCNFBMetricsProductivityEventDelegate clCNFBMetricsProductivity_GetOnUpdateEvent_60min(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for update event productivity metric 60 min.
clCNFBMetricsProductivity_GetOnBaselineCalibratedEvent
CL_DLL clCNFBMetricsProductivityCalibratedDelegate clCNFBMetricsProductivity_GetOnBaselineCalibratedEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for baseline calibration finished event.
clCNFBMetricsProductivityIndividualHandler
void(* clCNFBMetricsProductivityIndividualHandler)(clCNFBMetricProductivity, const clCNFBMetricsProductivityIndividualIndexes *)
Definition CNFBMetricsProductivity.h:114
clCNFBMetricsProductivity_CalibratedEvent_Set
CL_DLL void clCNFBMetricsProductivity_CalibratedEvent_Set(clCNFBMetricsProductivityCalibratedDelegate delegate, clCNFBMetricsProductivityCalibratedHandler handler) NOEXCEPT
Set handler for calibrated event NFB classifier, not involved yet.
clCNFBMetricsProductivity_InitialBaselineCalibratedEvent_Set
CL_DLL void clCNFBMetricsProductivity_InitialBaselineCalibratedEvent_Set(clCNFBMetricsProductivityInitialBaselineCalibratedDelegate delegate, clCNFBMetricsProductivityInitialBaselineCalibratedHandler handler) NOEXCEPT
Set delegate for initial baseline calibration finished event.
clCNFBMetricsProductivity_ArtifactsEvent_Set
CL_DLL void clCNFBMetricsProductivity_ArtifactsEvent_Set(clCNFBMetricsProductivityArtifactsDelegate delegate, clCNFBMetricsProductivityArtifactsHandler handler) NOEXCEPT
Set handler for occurrence artifacts event.
clCNFBMetricsProductivity_UpdateEvent_Set
CL_DLL void clCNFBMetricsProductivity_UpdateEvent_Set(clCNFBMetricsProductivityEventDelegate delegate, clCNFBMetricsProductivityEventHandler handler) NOEXCEPT
Set handler for update event productivity metrics: 1min, 5min ... 60min.
clCNFBMetricsProductivity_GetOnTrainingInfoEvent
CL_DLL clCNFBMetricsProductivityTrainingInfoDelegate clCNFBMetricsProductivity_GetOnTrainingInfoEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
clCNFBMetricsProductivity_relaxValue
float clCNFBMetricsProductivity_relaxValue
Definition CNFBMetricsProductivity.h:202
clCNFBMetricsProductivityInitialBaselineCalibratedHandler
void(* clCNFBMetricsProductivityInitialBaselineCalibratedHandler)(clCNFBMetricProductivity, const clCNFBMetricsProductivityBaselines *)
Definition CNFBMetricsProductivity.h:83
clCNFBMetricsProductivity_IndividualMeasuredEvent_Set
CL_DLL void clCNFBMetricsProductivity_IndividualMeasuredEvent_Set(clCNFBMetricsProductivityIndividualDelegate delegate, clCNFBMetricsProductivityIndividualHandler handler) NOEXCEPT
Set handler for Individual measure event.
clCNFBMetricsProductivity_GetOnProductivityValuesEvent
CL_DLL clCNFBMetricsProductivityValuesDelegate clCNFBMetricsProductivity_GetOnProductivityValuesEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for Productivity scores event.
clCNFBMetricsProductivityArtifactsHandler
void(* clCNFBMetricsProductivityArtifactsHandler)(clCNFBMetricProductivity, const clCNFBUserArtifacts *)
Definition CNFBMetricsProductivity.h:185
clCNFBMetricsProductivity_ResetAccumulatedFatigue
CL_DLL void clCNFBMetricsProductivity_ResetAccumulatedFatigue(clCNFBMetricProductivity nfbMetrics, clCError *error) NOEXCEPT
Reset accumulated fatigue and start calculated it from 0.
clCNFBMetricsProductivity_GetOnUpdateEvent_5min
CL_DLL clCNFBMetricsProductivityEventDelegate clCNFBMetricsProductivity_GetOnUpdateEvent_5min(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for update event productivity metric 5 min.
clCNFBMetricsProductivityCalibratedHandler
void(* clCNFBMetricsProductivityCalibratedHandler)(clCNFBMetricProductivity)
Definition CNFBMetricsProductivity.h:59
clCNFBMetricsProductivity_TrainingInfoEvent_Set
CL_DLL void clCNFBMetricsProductivity_TrainingInfoEvent_Set(clCNFBMetricsProductivityTrainingInfoDelegate delegate, clCNFBMetricsProductivityTrainingInfoHandler handler) NOEXCEPT
clCNFBMetricsProductivity_CurrentPowerIAPF
float clCNFBMetricsProductivity_CurrentPowerIAPF
Definition CNFBMetricsProductivity.h:201
clCNFBMetricsProductivity_GetOnArtifactsEvent
CL_DLL clCNFBMetricsProductivityArtifactsDelegate clCNFBMetricsProductivity_GetOnArtifactsEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for occurrence artifacts event.
clCNFBMetricsProductivityTrainingInfoHandler
void(* clCNFBMetricsProductivityTrainingInfoHandler)(clCNFBMetricProductivity, clCNFBMetricsProductivity_CurrentPowerIAPF, clCNFBMetricsProductivity_relaxValue)
Definition CNFBMetricsProductivity.h:205
clCNFBMetricsProductivity_Destroy
CL_DLL void clCNFBMetricsProductivity_Destroy(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Destroy NFB classifier. Release the NFBMetrics productivity handle.
clCNFBMetricsProductivity_GetOnUpdateEvent_30min
CL_DLL clCNFBMetricsProductivityEventDelegate clCNFBMetricsProductivity_GetOnUpdateEvent_30min(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for update event productivity metric 30 min.
clCNFBMetricsProductivity_CreateCalibrated
CL_DLL clCNFBMetricProductivity clCNFBMetricsProductivity_CreateCalibrated(clCNFBCalibrator calibrator, const char *path, double speed, double maxSpeed, double slowDown, clCError *error) NOEXCEPT
Create a NFB classifier for metrics productivity after individual NFB has been calibrated.
clCNFBMetricsProductivity_GetIAF
CL_DLL float clCNFBMetricsProductivity_GetIAF(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Set handler for Individual measure event.
clCNFBMetricsProductivity_GetIAPF
CL_DLL float clCNFBMetricsProductivity_GetIAPF(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Set handler for Individual measure event.
clCNFBMetricsProductivity_ValuesEvent_Set
CL_DLL void clCNFBMetricsProductivity_ValuesEvent_Set(clCNFBMetricsProductivityValuesDelegate delegate, clCNFBMetricsProductivityValuesHandler handler) NOEXCEPT
Set handler for Productivity scores event.
clCNFBMetricsProductivityValuesHandler
void(* clCNFBMetricsProductivityValuesHandler)(clCNFBMetricProductivity, const clCNFBMetricsProductivityValues *)
Definition CNFBMetricsProductivity.h:139
clCNFBMetricsProductivity_GetOnIndividualMeasuredEvent
CL_DLL clCNFBMetricsProductivityIndividualDelegate clCNFBMetricsProductivity_GetOnIndividualMeasuredEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for Individual measure event.
clCNFBMetricsProductivity_GetOnUpdateEvent_15min
CL_DLL clCNFBMetricsProductivityEventDelegate clCNFBMetricsProductivity_GetOnUpdateEvent_15min(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for update event productivity metric 15 min.
clCNFBMetricsProductivity_Create
CL_DLL clCNFBMetricProductivity clCNFBMetricsProductivity_Create(clCSession session, const char *path, double speed, double maxSpeed, double slowDown, clCError *error) NOEXCEPT
Create a NFB classifier for metrics productivity.
clCNFBMetricsProductivityEventHandler
void(* clCNFBMetricsProductivityEventHandler)(clCNFBMetricProductivity, float)
Definition CNFBMetricsProductivity.h:219
clCNFBMetricsProductivity_GetOnUpdateEvent_1min
CL_DLL clCNFBMetricsProductivityEventDelegate clCNFBMetricsProductivity_GetOnUpdateEvent_1min(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for update event productivity metric 1 min.
clCNFBMetricsProductivity_GetOnInitialBaselineCalibratedEvent
CL_DLL clCNFBMetricsProductivityInitialBaselineCalibratedDelegate clCNFBMetricsProductivity_GetOnInitialBaselineCalibratedEvent(clCNFBMetricProductivity nfbMetrics) NOEXCEPT
Get delegate for initial baseline calibration finished event.
clCNFBMetricsProductivity_InitializeNFB
CL_DLL void clCNFBMetricsProductivity_InitializeNFB(clCNFBMetricProductivity nfbMetrics, const char *platformAddress, clCError *error) NOEXCEPT
Initialize NFB classifier for metrics productivity.
CSession.h
clCNFBMetricsProductivityBaselines
Definition CNFBMetricsProductivity.h:74
clCNFBMetricsProductivityBaselines::relaxBaseline
float relaxBaseline
Definition CNFBMetricsProductivity.h:79
clCNFBMetricsProductivityBaselines::fatigueBaseline
float fatigueBaseline
Definition CNFBMetricsProductivity.h:77
clCNFBMetricsProductivityBaselines::gravityBaseline
float gravityBaseline
Definition CNFBMetricsProductivity.h:75
clCNFBMetricsProductivityBaselines::concentrationBaseline
float concentrationBaseline
Definition CNFBMetricsProductivity.h:80
clCNFBMetricsProductivityBaselines::productivityBaseline
float productivityBaseline
Definition CNFBMetricsProductivity.h:76
clCNFBMetricsProductivityBaselines::reverseFatigueBaseline
float reverseFatigueBaseline
Definition CNFBMetricsProductivity.h:78
clCNFBMetricsProductivityIndividualIndexes
Definition CNFBMetricsProductivity.h:98
clCNFBMetricsProductivityIndividualIndexes::concentrationBaseline
float concentrationBaseline
Definition CNFBMetricsProductivity.h:109
clCNFBMetricsProductivityIndividualIndexes::relaxPoint
uint8_t relaxPoint
Definition CNFBMetricsProductivity.h:104
clCNFBMetricsProductivityIndividualIndexes::stressPoint
uint8_t stressPoint
Definition CNFBMetricsProductivity.h:105
clCNFBMetricsProductivityIndividualIndexes::IAPF
float IAPF
Definition CNFBMetricsProductivity.h:100
clCNFBMetricsProductivityIndividualIndexes::alphaRangeEnd
float alphaRangeEnd
Definition CNFBMetricsProductivity.h:103
clCNFBMetricsProductivityIndividualIndexes::IAF
float IAF
Definition CNFBMetricsProductivity.h:99
clCNFBMetricsProductivityIndividualIndexes::isArtifacted
int isArtifacted
Definition CNFBMetricsProductivity.h:110
clCNFBMetricsProductivityIndividualIndexes::alphaRangeBegin
float alphaRangeBegin
Definition CNFBMetricsProductivity.h:102
clCNFBMetricsProductivityIndividualIndexes::relaxBaseline
float relaxBaseline
Definition CNFBMetricsProductivity.h:106
clCNFBMetricsProductivityIndividualIndexes::IAPFPowerNormalized
float IAPFPowerNormalized
Definition CNFBMetricsProductivity.h:101
clCNFBMetricsProductivityIndividualIndexes::gravityBaseline
float gravityBaseline
Definition CNFBMetricsProductivity.h:108
clCNFBMetricsProductivityIndividualIndexes::fatigueBaseline
float fatigueBaseline
Definition CNFBMetricsProductivity.h:107
clCNFBMetricsProductivityValues
Definition CNFBMetricsProductivity.h:129
clCNFBMetricsProductivityValues::gravityScore
float gravityScore
Definition CNFBMetricsProductivity.h:131
clCNFBMetricsProductivityValues::fatigueGrowthRate
int32_t fatigueGrowthRate
Definition CNFBMetricsProductivity.h:135
clCNFBMetricsProductivityValues::concentrationScore
float concentrationScore
Definition CNFBMetricsProductivity.h:132
clCNFBMetricsProductivityValues::relaxationScore
float relaxationScore
Definition CNFBMetricsProductivity.h:133
clCNFBMetricsProductivityValues::accumulatedFatigue
float accumulatedFatigue
Definition CNFBMetricsProductivity.h:134
clCNFBMetricsProductivityValues::fatigueScore
float fatigueScore
Definition CNFBMetricsProductivity.h:130
clCNFBUserArtifacts
Artifacts when measuring the state user.
Definition CNFBMetricsProductivity.h:175
clCNFBUserArtifacts::artifactsData
const uint8_t * artifactsData
Artifacts from channel.
Definition CNFBMetricsProductivity.h:179
clCNFBUserArtifacts::timestamp
int64_t timestamp
Definition CNFBMetricsProductivity.h:181
clCNFBUserArtifacts::artifactsSize
uint64_t artifactsSize
Definition CNFBMetricsProductivity.h:180