Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
Go to the documentation of this file.
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_OBSERVATION_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_OBSERVATION_H_
122 bool (*
ob_add_values_to_json_fn) (
const struct Observation *obs_p,
const char *raw_key_s,
const char *corrected_key_s, json_t *json_p,
const char *null_sequence_s,
bool only_if_exists_flag);
142 #ifndef DOXYGEN_SHOULD_SKIP_THIS
144 #ifdef ALLOCATE_OBSERVATION_TAGS
145 #define OBSERVATION_PREFIX DFW_FIELD_TRIAL_SERVICE_LOCAL
146 #define OBSERVATION_VAL(x) = x
147 #define OBSERVATION_CONCAT_VAL(x,y) = x y
149 #define OBSERVATION_PREFIX extern
150 #define OBSERVATION_VAL(x)
151 #define OBSERVATION_CONCAT_VAL(x,y)
157 OBSERVATION_PREFIX
const char *OB_PHENOTYPE_S
OBSERVATION_VAL (
"phenotype");
159 OBSERVATION_PREFIX
const char *OB_PHENOTYPE_ID_S
OBSERVATION_VAL (
"phenotype_id");
161 OBSERVATION_PREFIX
const char *OB_START_DATE_S
OBSERVATION_VAL (
"date");
163 OBSERVATION_PREFIX
const char *OB_END_DATE_S
OBSERVATION_VAL (
"end_date");
165 OBSERVATION_PREFIX
const char *OB_RAW_VALUE_S
OBSERVATION_VAL (
"raw_value");
167 OBSERVATION_PREFIX
const char *OB_INSTRUMENT_ID_S
OBSERVATION_VAL (
"instrument_id");
169 OBSERVATION_PREFIX
const char *OB_INSTRUMENT_S
OBSERVATION_VAL (
"instrument");
171 OBSERVATION_PREFIX
const char *OB_GROWTH_STAGE_S
OBSERVATION_VAL (
"growth_stage");
173 OBSERVATION_PREFIX
const char *OB_CORRECTED_VALUE_S
OBSERVATION_VAL (
"corrected_value");
182 OBSERVATION_PREFIX
const char *OB_TYPE_S
OBSERVATION_VAL (
"value_type");
197 MEM_FLAG phenotype_mem,
const json_t *raw_value_p,
const json_t *corrected_value_p,
199 const uint32 *index_p,
const char *notes_s,
const ObservationType obs_type);
202 MEM_FLAG phenotype_mem,
const json_t *raw_value_p,
const json_t *corrected_value_p,
204 const uint32 *index_p,
const char *notes_s,
const ObservationType obs_type,
205 void (*on_error_callback_fn) (
ServiceJob *job_p,
const char *
const observation_field_s,
const void *value_p,
void *user_data_p),
211 bool (*add_values_to_json_fn) (
const struct Observation *obs_p,
const char *raw_key_s,
const char *corrected_key_s, json_t *json_p,
const char *null_sequence_s,
bool only_if_exists_flag),
Observation * GetObservationFromJSON(const json_t *phenotype_json_p, FieldTrialServiceData *data_p)
ObservationValueType
Definition: observation.h:50
Observation * on_observation_p
Definition: observation.h:137
char * ob_growth_stage_s
Definition: observation.h:92
char * ob_method_s
Definition: observation.h:94
bool SetObservationRawValueFromJSON(Observation *observation_p, const json_t *value_p)
bool AreObservationsMatchingByParts(const Observation *observation_p, const MeasuredVariable *variable_p, const struct tm *start_date_p, const struct tm *end_date_p, const uint32 *index_p)
Definition: instrument.h:33
bool(* ob_set_value_from_string_fn)(struct Observation *observation_p, ObservationValueType ovt, const char *value_s)
Definition: observation.h:126
MEM_FLAG
An enum specifying the particular status of a piece of dynamically allocated memory for a particular ...
Definition: memory_allocations.h:38
bool SaveObservation(Observation *observation_p, const FieldTrialServiceData *data_p)
A datatype to represent a running task.
Definition: service_job.h:72
bool AreObservationsMatching(const Observation *observation_0_p, const Observation *observation_1_p)
Test whether two Observations are the same in terms of phenotypes, dates and observation indexes.
ListItem on_node
Definition: observation.h:135
bool SetObservationCorrectedValueFromJSON(Observation *observation_p, const json_t *value_p)
ObservationType ob_type
Definition: observation.h:117
MeasuredVariable * ob_phenotype_p
The MeasuredVariable that this Observation is measuring.
Definition: observation.h:82
const char * GetObservationTypeAsString(const ObservationType obs_type)
bool SetObservationRawValueFromString(Observation *observation_p, const char *const value_s)
void(* ob_clear_fn)(struct Observation *observation_p)
Definition: observation.h:120
MEM_FLAG ob_phenotype_mem
Definition: observation.h:85
bool(* ob_get_value_as_string_fn)(struct Observation *observation_p, ObservationValueType ovt, char **value_ss, bool *free_value_flag_p)
Definition: observation.h:128
ObservationNode * AllocateObservationNode(Observation *observation_p)
Allocate an ObservationNode for a given Observation.
bool DetermineObservationTypeFromString(const char *const obs_type_s, ObservationType *obs_type_p)
Definition: observation.h:34
Definition: observation.h:35
Definition: observation.h:53
Definition: observation.h:45
struct tm * ob_start_date_p
The date and time when the measuring for this Observation was started.
Definition: observation.h:71
bool AddObservationValuesToFrictionlessData(Observation *obs_p, json_t *fd_json_p)
void FreeObservation(Observation *observation_p)
Free an Observation.
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
Definition: measured_variable.h:39
struct tm * ob_end_date_p
The date and time when the measuring for this Observation was started.
Definition: observation.h:77
#define DFW_FIELD_TRIAL_SERVICE_API
Definition: dfw_field_trial_service_library.h:42
Definition: observation.h:46
uint32 ob_index
For some phenotype data multiple data points are taken from the same plot e.g.
Definition: observation.h:114
bson_oid_t * ob_id_p
Definition: observation.h:65
Observation * AllocateObservationWithErrorHandler(bson_oid_t *id_p, const struct tm *start_date_p, const struct tm *end_date_p, MeasuredVariable *phenotype_p, MEM_FLAG phenotype_mem, const json_t *raw_value_p, const json_t *corrected_value_p, const char *growth_stage_s, const char *method_s, Instrument *instrument_p, const ObservationNature nature, const uint32 *index_p, const char *notes_s, const ObservationType obs_type, void(*on_error_callback_fn)(ServiceJob *job_p, const char *const observation_field_s, const void *value_p, void *user_data_p), ServiceJob *job_p, void *user_data_p)
void FreeObservationNode(ListItem *node_p)
Free an ObservationNode.
void ClearObservation(Observation *observation_p)
Clear the data stored within an Observation.
const OBSERVATION_PREFIX char *OB_PHENOTYPE_S OBSERVATION_VAL("phenotype")
bool(* ob_add_values_to_json_fn)(const struct Observation *obs_p, const char *raw_key_s, const char *corrected_key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag)
Definition: observation.h:122
Definition: observation.h:44
Definition: observation.h:43
bool(* ob_set_value_from_json_fn)(struct Observation *observation_p, ObservationValueType ovt, const json_t *value_p)
Definition: observation.h:124
ObservationNature
Definition: observation.h:41
bool SetObservationCorrectedValueFromString(Observation *observation_p, const char *const value_s)
Definition: observation.h:36
json_t * GetObservationAsJSON(const Observation *observation_p, const ViewFormat format)
ObservationType GetObservationTypeForScaleClass(const ScaleClass *class_p)
A datatype for storing a phneotypic observation within an experiment.
Definition: observation.h:63
Instrument * ob_instrument_p
Definition: observation.h:87
Definition: observation.h:38
Definition: dfw_field_trial_service_data.h:105
Definition: observation.h:37
The configuration data used by the DFW Field Trial Service.
Definition: dfw_field_trial_service_data.h:118
ObservationNature ob_nature
Definition: observation.h:103
Observation * AllocateObservation(bson_oid_t *id_p, const struct tm *start_date_p, const struct tm *end_date_p, MeasuredVariable *phenotype_p, MEM_FLAG phenotype_mem, const json_t *raw_value_p, const json_t *corrected_value_p, const char *growth_stage_s, const char *method_s, Instrument *instrument_p, const ObservationNature nature, const uint32 *index_p, const char *notes_s, const ObservationType obs_type)
char * ob_notes_s
Any notes about this observation.
Definition: observation.h:100
Definition: observation.h:133
bool InitObservation(Observation *observation_p, bson_oid_t *id_p, const struct tm *start_date_p, const struct tm *end_date_p, MeasuredVariable *phenotype_p, MEM_FLAG phenotype_mem, const char *growth_stage_s, const char *method_s, Instrument *instrument_p, const ObservationNature nature, const uint32 *index_p, const char *notes_s, const ObservationType obs_type, void(*clear_fn)(Observation *observation_p), bool(*add_values_to_json_fn)(const struct Observation *obs_p, const char *raw_key_s, const char *corrected_key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag), bool(*set_value_from_json_fn)(struct Observation *observation_p, ObservationValueType ovt, const json_t *value_p), bool(*set_value_from_string_fn)(struct Observation *observation_p, ObservationValueType ovt, const char *value_s), bool(*get_value_as_string_fn)(struct Observation *observation_p, ObservationValueType ovt, char **value_ss, bool *free_value_flag_p))
Definition: observation.h:52
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43
ObservationType
Definition: observation.h:32