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.
row_jobs.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2018 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 /*
17  * row_jobs.h
18  *
19  * Created on: 28 Oct 2018
20  * Author: billy
21  */
22 
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_ROW_JOBS_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_ROW_JOBS_H_
25 
28 
29 #include "standard_row.h"
30 
31 #include "plot.h"
32 #include "treatment_factor_value.h"
33 
34 
35 
36 
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 
44 
45 DFW_FIELD_TRIAL_SERVICE_LOCAL Row *GetRowByRackIndex (const int32 row, Plot *plot_p, const bool expand_fields_flag, const FieldTrialServiceData *data_p);
46 
47 
48 DFW_FIELD_TRIAL_SERVICE_LOCAL Row *GetRowByStudyIndex (const int32 by_study_index, Study *study_p, const ViewFormat format, FieldTrialServiceData *data_p);
49 
50 
52 
53 
54 
55 DFW_FIELD_TRIAL_SERVICE_LOCAL OperationStatus AddObservationValueToStandardRow (StandardRow *row_p, const uint32 row_index, const char *key_s, const json_t *value_p, ServiceJob *job_p, FieldTrialServiceData *data_p);
56 
57 
59 
60 
61 DFW_FIELD_TRIAL_SERVICE_LOCAL OperationStatus AddStatsValuesToBaseRow (Row *row_p, json_t *stas_json_p, Study *study_p, ServiceJob *job_p, const uint32 row_index, FieldTrialServiceData *data_p);
62 
63 
65 
66 DFW_FIELD_TRIAL_SERVICE_LOCAL json_t *GetRowAsFrictionlessData (const Row *row_p, const Study * const study_p, const FieldTrialServiceData *service_data_p, const char * const null_sequence_s);
67 
68 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddRowFrictionlessDataDetails (const Row *row_p, json_t *row_fd_p, const FieldTrialServiceData *service_data_p, const char * const null_sequence_s);
69 
70 
71 DFW_FIELD_TRIAL_SERVICE_LOCAL Observation *GetMatchingObservation (const StandardRow *row_p, const MeasuredVariable *variable_p, const struct tm *start_date_p, const struct tm *end_date_p, const uint32 *index_p);
72 
73 
74 DFW_FIELD_TRIAL_SERVICE_LOCAL ObservationNode *GetMatchingObservationNode (const StandardRow *row_p, const MeasuredVariable *variable_p, const struct tm *start_date_p, const struct tm *end_date_p, const uint32 *index_p);
75 
76 
78 
79 
80 DFW_FIELD_TRIAL_SERVICE_LOCAL OperationStatus AddSingleTreatmentFactorValueToStandardRow (StandardRow *row_p, const char *key_s, const char *value_s, Study *study_p, ServiceJob *job_p, const uint32 row_index, FieldTrialServiceData *data_p);
81 
82 
84 
86 
87 
88 DFW_FIELD_TRIAL_SERVICE_LOCAL Row *GetRowByIdString (const char *row_id_s, const ViewFormat format, const FieldTrialServiceData *data_p);
89 
90 
92 
93 
95 
96 
97 DFW_FIELD_TRIAL_SERVICE_LOCAL OperationStatus AddObservationValueToStandardRowByParts (ServiceJob *job_p, StandardRow *row_p, MeasuredVariable *measured_variable_p, struct tm *start_date_p, struct tm *end_date_p,
98  const char *key_s, const json_t *raw_value_p, const json_t *corrected_value_p, const char *notes_s, const uint32 observation_index, bool *free_measured_variable_flag_p,
99  void (*on_error_callback_fn) (ServiceJob *job_p, const char * const observation_field_s, const void *value_p, void *user_data_p), void *user_data_p);
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 
106 
107 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_ROW_JOBS_H_ */
StandardRow
Definition: standard_row.h:39
standard_row.h
Plot
Definition: plot.h:84
AddTreatmentFactorValueToRowByParts
bool AddTreatmentFactorValueToRowByParts(StandardRow *row_p, TreatmentFactor *tf_p, const char *value_s)
AddStatsValuesToBaseRow
OperationStatus AddStatsValuesToBaseRow(Row *row_p, json_t *stas_json_p, Study *study_p, ServiceJob *job_p, const uint32 row_index, FieldTrialServiceData *data_p)
GetDiscardValueFromSubmissionJSON
bool GetDiscardValueFromSubmissionJSON(const json_t *row_json_p)
ServiceJob
A datatype to represent a running task.
Definition: service_job.h:72
treatment_factor_value.h
GetRowAsFrictionlessData
json_t * GetRowAsFrictionlessData(const Row *row_p, const Study *const study_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s)
AddObservationValueToStandardRowByParts
OperationStatus AddObservationValueToStandardRowByParts(ServiceJob *job_p, StandardRow *row_p, MeasuredVariable *measured_variable_p, struct tm *start_date_p, struct tm *end_date_p, const char *key_s, const json_t *raw_value_p, const json_t *corrected_value_p, const char *notes_s, const uint32 observation_index, bool *free_measured_variable_flag_p, void(*on_error_callback_fn)(ServiceJob *job_p, const char *const observation_field_s, const void *value_p, void *user_data_p), void *user_data_p)
TreatmentFactor
A TreatmentFactor is a set of values for a Treatment applied to plots within a Study.
Definition: treatment_factor.h:76
Material
Definition: material.h:121
GetRowByStudyIndex
Row * GetRowByStudyIndex(const int32 by_study_index, Study *study_p, const ViewFormat format, FieldTrialServiceData *data_p)
dfw_field_trial_service_library.h
FreeRowsNameKey
void FreeRowsNameKey(char *key_s)
GetMatchingObservationNode
ObservationNode * GetMatchingObservationNode(const StandardRow *row_p, const MeasuredVariable *variable_p, const struct tm *start_date_p, const struct tm *end_date_p, const uint32 *index_p)
DFW_FIELD_TRIAL_SERVICE_LOCAL
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
MeasuredVariable
Definition: measured_variable.h:39
LinkedList
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
AddSingleTreatmentFactorValueToStandardRow
OperationStatus AddSingleTreatmentFactorValueToStandardRow(StandardRow *row_p, const char *key_s, const char *value_s, Study *study_p, ServiceJob *job_p, const uint32 row_index, FieldTrialServiceData *data_p)
OperationStatus
OperationStatus
The current status of an Operation.
Definition: operation.h:96
AddRowFrictionlessDataDetails
bool AddRowFrictionlessDataDetails(const Row *row_p, json_t *row_fd_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s)
GetRowByRackIndex
Row * GetRowByRackIndex(const int32 row, Plot *plot_p, const bool expand_fields_flag, const FieldTrialServiceData *data_p)
AddObservationValueToStandardRow
OperationStatus AddObservationValueToStandardRow(StandardRow *row_p, const uint32 row_index, const char *key_s, const json_t *value_p, ServiceJob *job_p, FieldTrialServiceData *data_p)
GetRowsNameKey
char * GetRowsNameKey(void)
GetAllRowsContainingMaterial
LinkedList * GetAllRowsContainingMaterial(Material *material_p, const FieldTrialServiceData *data_p)
dfw_field_trial_service_data.h
AddTreatmentFactorValuesToStandardRow
OperationStatus AddTreatmentFactorValuesToStandardRow(StandardRow *row_p, json_t *plot_json_p, Study *study_p, FieldTrialServiceData *data_p)
RemoveObservationNode
void RemoveObservationNode(const StandardRow *row_p, ObservationNode *node_p)
Observation
A datatype for storing a phneotypic observation within an experiment.
Definition: observation.h:63
GetBlankValueFromSubmissionJSON
bool GetBlankValueFromSubmissionJSON(const json_t *row_json_p)
FieldTrialServiceData
The configuration data used by the DFW Field Trial Service.
Definition: dfw_field_trial_service_data.h:118
ViewFormat
ViewFormat
An indicator of what the output destination is for the JSON data values.
Definition: view_format.h:19
GetMatchingObservation
Observation * GetMatchingObservation(const StandardRow *row_p, const MeasuredVariable *variable_p, const struct tm *start_date_p, const struct tm *end_date_p, const uint32 *index_p)
GetRowByIdString
Row * GetRowByIdString(const char *row_id_s, const ViewFormat format, const FieldTrialServiceData *data_p)
plot.h
Study
Definition: study.h:182
ObservationNode
Definition: observation.h:133
Row
Definition: row.h:54