Capsule API Example

Loading...
Searching...
No Matches
CProductivity.h
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5#include "CDefinesPrivate.h"
6#include "CError.h"
7#include "CNFBCalibrator.h"
8
9#ifdef __cplusplus
10#include <cstddef>
11 extern "C" {
12#else
13#include <stddef.h>
14#endif
15
16 CLC_CLASS_WN(ClassificationProductivityPrivate, clCProductivity);
17
18 typedef enum clCProductivity_FatigueGrowthRate {
19 clCProductivity_FatigueGrowthRate_None,
20 clCProductivity_FatigueGrowthRate_Low,
21 clCProductivity_FatigueGrowthRate_Medium,
22 clCProductivity_FatigueGrowthRate_High
23} clCProductivity_FatigueGrowthRate;
24
25 typedef struct clCProductivity_Metrics {
26 int64_t timestampMilli = -1;
27 float fatigueScore = -1.F;
28 float reverseFatigueScore = -1.F;
29 float gravityScore = -1.F;
30 float relaxationScore = -1.F;
31 float concentrationScore = -1.F;
32 float productivityScore = -1.F;
33 float currentValue = -1.F;
34 float alpha = -1.F;
35 float productivityBaseline = -1.F;
36 float accumulatedFatigue = -1.F;
37 clCProductivity_FatigueGrowthRate fatigueGrowthRate = clCProductivity_FatigueGrowthRate_None;
38 const uint8_t* artifactsData = NULL;
39 uint64_t artifactsSize = 0U;
40} clCProductivity_Metrics;
41
42 typedef enum clCProductivity_RecommendationValue {
43 clCProductivity_RecommendationValue_NoRecommendation,
44 clCProductivity_RecommendationValue_Involvement,
45 clCProductivity_RecommendationValue_Relaxation,
46 clCProductivity_RecommendationValue_SlightFatigue,
47 clCProductivity_RecommendationValue_SevereFatigue,
48 clCProductivity_RecommendationValue_ChronicFatigue
49} clCProductivity_RecommendationValue;
50
51 typedef enum clCProductivity_StressValue {
52 clCProductivity_StressValue_NoStress,
53 clCProductivity_StressValue_Anxiety,
54 clCProductivity_StressValue_Stress
55} clCProductivity_StressValue;
56
57 typedef struct clCProductivity_Indexes {
58 int64_t timestampMilli = -1;
59 clCProductivity_RecommendationValue relaxation = clCProductivity_RecommendationValue_NoRecommendation;
60 clCProductivity_StressValue stress = clCProductivity_StressValue_NoStress;
61 float gravityBaseline = -1.F;
62 float productivityBaseline = -1.F;
63 float fatigueBaseline = -1.F;
64 float reverseFatigueBaseline = -1.F;
65 float relaxationBaseline = -1.F;
66 float concentrationBaseline = -1.F;
67 bool hasArtifacts = false;
68} clCProductivity_Indexes;
69
70 typedef struct clCProductivity_Baselines {
71 int64_t timestampMilli = -1;
72 float gravity = -1.F;
73 float productivity = -1.F;
74 float fatigue = -1.F;
75 float reverseFatigue = -1.F;
76 float relaxation = -1.F;
77 float concentration = -1.F;
78} clCProductivity_Baselines;
79
80 CL_DLL clCProductivity clCProductivity_Create(clCDevice device, clCError* error) NOEXCEPT;
81 CL_DLL clCProductivity clCProductivity_CreateWithIndividualData(clCDevice device, const clCIndividualNFBData* data, clCError* error) NOEXCEPT;
82
83 CL_DLL void clCProductivity_ImportBaselines(clCProductivity productivity, const clCProductivity_Baselines* baselines, clCError* error) NOEXCEPT;
84 CL_DLL void clCProductivity_ResetAccumulatedFatigue(clCProductivity productivity, clCError* error) NOEXCEPT;
85 CL_DLL void clCProductivity_StartBaselineCalibration(clCProductivity productivity) NOEXCEPT;
86
87 typedef void (*clCProductivity_BaselineCalibratedHandler)(clCProductivity, const clCProductivity_Baselines*) NOEXCEPT;
88 CL_DLL void clCProductivity_SetOnBaselineUpdateEvent(clCProductivity productivityPtr, clCProductivity_BaselineCalibratedHandler handler) NOEXCEPT;
89
90 typedef void (*clCProductivity_MetricsUpdateHandler)(clCProductivity, const clCProductivity_Metrics*) NOEXCEPT;
91 CL_DLL void clCProductivity_SetOnMetricsUpdateEvent(clCProductivity productivityPtr, clCProductivity_MetricsUpdateHandler handler) NOEXCEPT;
92
93 typedef void (*clCProductivity_IndexesStateUpdateHandler)(clCProductivity, const clCProductivity_Indexes*) NOEXCEPT;
94 CL_DLL void clCProductivity_SetOnIndexesUpdateEvent(clCProductivity productivityPtr, clCProductivity_IndexesStateUpdateHandler handler) NOEXCEPT;
95
96 typedef void (*clCProductivity_CalibrationProgressUpdateHandler)(clCProductivity, float) NOEXCEPT;
97 CL_DLL void clCProductivity_SetOnCalibrationProgressUpdateEvent(clCProductivity productivity, clCProductivity_CalibrationProgressUpdateHandler handler) NOEXCEPT;
98
99 typedef void (*clCProductivity_IndividualNFBUpdateHandler)(clCProductivity) NOEXCEPT;
100 CL_DLL void clCProductivity_SetOnIndividualNFBUpdateEvent(clCProductivity productivity, clCProductivity_IndividualNFBUpdateHandler handler) NOEXCEPT;
101
102#ifdef __cplusplus
103}
104#endif
CDefinesPrivate.h
NOEXCEPT
#define NOEXCEPT
Definition CDefinesPrivate.h:82
CL_DLL
#define CL_DLL
Definition CDefinesPrivate.h:51
CLC_CLASS_WN
#define CLC_CLASS_WN(Wrapped, Name)
Definition CDefinesPrivate.h:84
CError.h
CNFBCalibrator.h
clCProductivity_CalibrationProgressUpdateHandler
void(* clCProductivity_CalibrationProgressUpdateHandler)(clCProductivity, float) NOEXCEPT
Definition CProductivity.h:96
clCProductivity_SetOnCalibrationProgressUpdateEvent
CL_DLL void clCProductivity_SetOnCalibrationProgressUpdateEvent(clCProductivity productivity, clCProductivity_CalibrationProgressUpdateHandler handler) NOEXCEPT
clCProductivity_IndividualNFBUpdateHandler
void(* clCProductivity_IndividualNFBUpdateHandler)(clCProductivity) NOEXCEPT
Definition CProductivity.h:99
clCProductivity_MetricsUpdateHandler
void(* clCProductivity_MetricsUpdateHandler)(clCProductivity, const clCProductivity_Metrics *) NOEXCEPT
Definition CProductivity.h:90
clCProductivity_SetOnIndexesUpdateEvent
CL_DLL void clCProductivity_SetOnIndexesUpdateEvent(clCProductivity productivityPtr, clCProductivity_IndexesStateUpdateHandler handler) NOEXCEPT
clCProductivity_BaselineCalibratedHandler
void(* clCProductivity_BaselineCalibratedHandler)(clCProductivity, const clCProductivity_Baselines *) NOEXCEPT
Definition CProductivity.h:87
clCProductivity_SetOnIndividualNFBUpdateEvent
CL_DLL void clCProductivity_SetOnIndividualNFBUpdateEvent(clCProductivity productivity, clCProductivity_IndividualNFBUpdateHandler handler) NOEXCEPT
clCProductivity_CreateWithIndividualData
CL_DLL clCProductivity clCProductivity_CreateWithIndividualData(clCDevice device, const clCIndividualNFBData *data, clCError *error) NOEXCEPT
clCProductivity_Metrics
struct clCProductivity_Metrics clCProductivity_Metrics
clCProductivity_Baselines
struct clCProductivity_Baselines clCProductivity_Baselines
clCProductivity_FatigueGrowthRate
clCProductivity_FatigueGrowthRate
Definition CProductivity.h:18
clCProductivity_FatigueGrowthRate_Medium
@ clCProductivity_FatigueGrowthRate_Medium
Definition CProductivity.h:21
clCProductivity_FatigueGrowthRate_Low
@ clCProductivity_FatigueGrowthRate_Low
Definition CProductivity.h:20
clCProductivity_FatigueGrowthRate_High
@ clCProductivity_FatigueGrowthRate_High
Definition CProductivity.h:22
clCProductivity_FatigueGrowthRate_None
@ clCProductivity_FatigueGrowthRate_None
Definition CProductivity.h:19
clCProductivity_SetOnMetricsUpdateEvent
CL_DLL void clCProductivity_SetOnMetricsUpdateEvent(clCProductivity productivityPtr, clCProductivity_MetricsUpdateHandler handler) NOEXCEPT
clCProductivity_StartBaselineCalibration
CL_DLL void clCProductivity_StartBaselineCalibration(clCProductivity productivity) NOEXCEPT
clCProductivity_Create
CL_DLL clCProductivity clCProductivity_Create(clCDevice device, clCError *error) NOEXCEPT
clCProductivity_StressValue
clCProductivity_StressValue
Definition CProductivity.h:51
clCProductivity_StressValue_Stress
@ clCProductivity_StressValue_Stress
Definition CProductivity.h:54
clCProductivity_StressValue_Anxiety
@ clCProductivity_StressValue_Anxiety
Definition CProductivity.h:53
clCProductivity_StressValue_NoStress
@ clCProductivity_StressValue_NoStress
Definition CProductivity.h:52
clCProductivity_RecommendationValue
clCProductivity_RecommendationValue
Definition CProductivity.h:42
clCProductivity_RecommendationValue_ChronicFatigue
@ clCProductivity_RecommendationValue_ChronicFatigue
Definition CProductivity.h:48
clCProductivity_RecommendationValue_SevereFatigue
@ clCProductivity_RecommendationValue_SevereFatigue
Definition CProductivity.h:47
clCProductivity_RecommendationValue_SlightFatigue
@ clCProductivity_RecommendationValue_SlightFatigue
Definition CProductivity.h:46
clCProductivity_RecommendationValue_NoRecommendation
@ clCProductivity_RecommendationValue_NoRecommendation
Definition CProductivity.h:43
clCProductivity_RecommendationValue_Relaxation
@ clCProductivity_RecommendationValue_Relaxation
Definition CProductivity.h:45
clCProductivity_RecommendationValue_Involvement
@ clCProductivity_RecommendationValue_Involvement
Definition CProductivity.h:44
clCProductivity_Indexes
struct clCProductivity_Indexes clCProductivity_Indexes
clCProductivity_IndexesStateUpdateHandler
void(* clCProductivity_IndexesStateUpdateHandler)(clCProductivity, const clCProductivity_Indexes *) NOEXCEPT
Definition CProductivity.h:93
clCProductivity_ImportBaselines
CL_DLL void clCProductivity_ImportBaselines(clCProductivity productivity, const clCProductivity_Baselines *baselines, clCError *error) NOEXCEPT
clCProductivity_ResetAccumulatedFatigue
CL_DLL void clCProductivity_ResetAccumulatedFatigue(clCProductivity productivity, clCError *error) NOEXCEPT
clCProductivity_SetOnBaselineUpdateEvent
CL_DLL void clCProductivity_SetOnBaselineUpdateEvent(clCProductivity productivityPtr, clCProductivity_BaselineCalibratedHandler handler) NOEXCEPT
clCError
Definition CError.h:28
clCIndividualNFBData
Definition CNFBCalibrator.h:31
clCProductivity_Baselines
Definition CProductivity.h:70
clCProductivity_Baselines::concentration
float concentration
Definition CProductivity.h:77
clCProductivity_Baselines::fatigue
float fatigue
Definition CProductivity.h:74
clCProductivity_Baselines::productivity
float productivity
Definition CProductivity.h:73
clCProductivity_Baselines::reverseFatigue
float reverseFatigue
Definition CProductivity.h:75
clCProductivity_Baselines::relaxation
float relaxation
Definition CProductivity.h:76
clCProductivity_Baselines::timestampMilli
int64_t timestampMilli
Definition CProductivity.h:71
clCProductivity_Baselines::gravity
float gravity
Definition CProductivity.h:72
clCProductivity_Indexes
Definition CProductivity.h:57
clCProductivity_Indexes::productivityBaseline
float productivityBaseline
Definition CProductivity.h:62
clCProductivity_Indexes::relaxationBaseline
float relaxationBaseline
Definition CProductivity.h:65
clCProductivity_Indexes::stress
clCProductivity_StressValue stress
Definition CProductivity.h:60
clCProductivity_Indexes::hasArtifacts
bool hasArtifacts
Definition CProductivity.h:67
clCProductivity_Indexes::fatigueBaseline
float fatigueBaseline
Definition CProductivity.h:63
clCProductivity_Indexes::relaxation
clCProductivity_RecommendationValue relaxation
Definition CProductivity.h:59
clCProductivity_Indexes::timestampMilli
int64_t timestampMilli
Definition CProductivity.h:58
clCProductivity_Indexes::concentrationBaseline
float concentrationBaseline
Definition CProductivity.h:66
clCProductivity_Indexes::reverseFatigueBaseline
float reverseFatigueBaseline
Definition CProductivity.h:64
clCProductivity_Indexes::gravityBaseline
float gravityBaseline
Definition CProductivity.h:61
clCProductivity_Metrics
Definition CProductivity.h:25
clCProductivity_Metrics::reverseFatigueScore
float reverseFatigueScore
Definition CProductivity.h:28
clCProductivity_Metrics::alpha
float alpha
Definition CProductivity.h:34
clCProductivity_Metrics::accumulatedFatigue
float accumulatedFatigue
Definition CProductivity.h:36
clCProductivity_Metrics::currentValue
float currentValue
Definition CProductivity.h:33
clCProductivity_Metrics::productivityBaseline
float productivityBaseline
Definition CProductivity.h:35
clCProductivity_Metrics::fatigueScore
float fatigueScore
Definition CProductivity.h:27
clCProductivity_Metrics::gravityScore
float gravityScore
Definition CProductivity.h:29
clCProductivity_Metrics::productivityScore
float productivityScore
Definition CProductivity.h:32
clCProductivity_Metrics::timestampMilli
int64_t timestampMilli
Definition CProductivity.h:26
clCProductivity_Metrics::relaxationScore
float relaxationScore
Definition CProductivity.h:30
clCProductivity_Metrics::artifactsData
const uint8_t * artifactsData
Definition CProductivity.h:38
clCProductivity_Metrics::fatigueGrowthRate
clCProductivity_FatigueGrowthRate fatigueGrowthRate
Definition CProductivity.h:37
clCProductivity_Metrics::concentrationScore
float concentrationScore
Definition CProductivity.h:31
clCProductivity_Metrics::artifactsSize
uint64_t artifactsSize
Definition CProductivity.h:39