Cortex Android
 All Classes Namespaces Functions Variables
nl.sense_os.cortex.MentalResilienceSensor Class Reference
Inheritance diagram for nl.sense_os.cortex.MentalResilienceSensor:

Public Member Functions

void setSaveToSensor (boolean saveToSensor)
 
void sendMentalResilience (String question, double score, int question_id, int answer_id, String answer, Task.TYPE taskType)
 
void sendMentalResilience (String question, double score, int question_id, int answer_id, String answer, Task.TYPE taskType, long date)
 

Static Public Member Functions

static MentalResilienceSensor getInstance (SensePlatform sensePlatform)
 
static MentalResilienceSensor getInstance ()
 

Static Public Attributes

static final String name = Sensors.getSENSOR_MENTAL_RESILIENCE()
 
static final String FIELD_QUESTION = "question"
 
static final String FIELD_ANSWER = "answer"
 
static final String FIELD_QUESTION_ID = "question_id"
 
static final String FIELD_ANSWER_ID = "answer_id"
 
static final String FIELD_SCORE = "score"
 
static final String FIELD_TASK_TYPE = "task_type"
 

Detailed Description

This class sends mental resilience data as the mental_resilience sensor to it's subscribers and optionally stores and uploads the data as sensor data in CommonSense.

Date
Oct 1 2014
Author
ted@s.nosp@m.ense.nosp@m.-os.n.nosp@m.l

Member Function Documentation

static MentalResilienceSensor nl.sense_os.cortex.MentalResilienceSensor.getInstance ( SensePlatform  sensePlatform)
static

Get the instance of the mental resilience sensor.

By default the sensor data is not stored locally and not send to CommonSense.

Parameters
sensePlatformA binded sensePlatform object
Returns
The initiated MentalResilienceSensor
void nl.sense_os.cortex.MentalResilienceSensor.sendMentalResilience ( String  question,
double  score,
int  question_id,
int  answer_id,
String  answer,
Task.TYPE  taskType 
)

Send the mental resilience value

This function sends the mental resilience value as sensor data to the subscribers.
If save to sensor is set to true it will be stored locally and send to CommonSense.

Parameters
questionThe question text
scoreThe mental resilience value (e.g. 30)
question_idThe identifier of the question (e.g. stylemsg_id)
answer_idThe identifier of the answer (e.g. 2, for a 10 point scale 0-9)
answerThe string representation of the answer (e.g. 30%)
taskTypeThe Task.TYPE representing the domain to which this question belongs to (e.g. MR_TASK_DOMAIN_1)
void nl.sense_os.cortex.MentalResilienceSensor.sendMentalResilience ( String  question,
double  score,
int  question_id,
int  answer_id,
String  answer,
Task.TYPE  taskType,
long  date 
)

Send the mental resilience value with a custom date

This function sends the mental resilience value as sensor data to the subscribers.
If save to sensor is set to true it will be stored locally and send to CommonSense.

Parameters
questionThe question text
scoreThe mental resilience value (e.g. 30)
question_idThe identifier of the question (e.g. stylemsg_id)
answer_idThe identifier of the answer (e.g. 2, for a 10 point scale 0-9)
answerThe string representation of the answer (e.g. 30%)
taskTypeThe Task.TYPE representing the domain to which this question belongs to (e.g. MR_TASK_DOMAIN_1)
dateThe date of the sensor data point in epoch time stamp in ms
void nl.sense_os.cortex.MentalResilienceSensor.setSaveToSensor ( boolean  saveToSensor)

Set to save the data and send it to CommonSense

Parameters
saveToSensorIf true the data is stored in a local buffer and send to CommonSense afterwards. If false it's only send to the subscribers of the sensor.

The documentation for this class was generated from the following file: